Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. how can i set message map for dynamic created CEdit [modified]

how can i set message map for dynamic created CEdit [modified]

Scheduled Pinned Locked Moved C / C++ / MFC
question
6 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    mwolf122
    wrote on last edited by
    #1

    hallo, in order to display and change a date list written in a txt file, seveal CEdit and CSpinCtrl should be dynamic created. The amount for the set of Editbox and SpinCtrl should be dynamic decided, according to the count of date set. CSpinCtrl and CEdit has the same behavior. I cant set the Message using ClassWizard, How can I dynamic set the Message for the CEdit and CspinCtrl? I have tried, in the Class, a Message Map UDN_DELTAPOS (ID, OnEditChange()). I set all the CSpinCtrl with the same ID. In this way, when any CspinCtrl changes, the function OnEditChange() will be called, but i can not recognize which one has been clicked. does anyone who has a solution? thanks ;) mwolf

    H F M 3 Replies Last reply
    0
    • M mwolf122

      hallo, in order to display and change a date list written in a txt file, seveal CEdit and CSpinCtrl should be dynamic created. The amount for the set of Editbox and SpinCtrl should be dynamic decided, according to the count of date set. CSpinCtrl and CEdit has the same behavior. I cant set the Message using ClassWizard, How can I dynamic set the Message for the CEdit and CspinCtrl? I have tried, in the Class, a Message Map UDN_DELTAPOS (ID, OnEditChange()). I set all the CSpinCtrl with the same ID. In this way, when any CspinCtrl changes, the function OnEditChange() will be called, but i can not recognize which one has been clicked. does anyone who has a solution? thanks ;) mwolf

      H Offline
      H Offline
      Hamid Taebi
      wrote on last edited by
      #2

      See these messages for Editbox and for send you can use of SendMessage.Edit Boxes Messages[^]

      1 Reply Last reply
      0
      • M mwolf122

        hallo, in order to display and change a date list written in a txt file, seveal CEdit and CSpinCtrl should be dynamic created. The amount for the set of Editbox and SpinCtrl should be dynamic decided, according to the count of date set. CSpinCtrl and CEdit has the same behavior. I cant set the Message using ClassWizard, How can I dynamic set the Message for the CEdit and CspinCtrl? I have tried, in the Class, a Message Map UDN_DELTAPOS (ID, OnEditChange()). I set all the CSpinCtrl with the same ID. In this way, when any CspinCtrl changes, the function OnEditChange() will be called, but i can not recognize which one has been clicked. does anyone who has a solution? thanks ;) mwolf

        F Offline
        F Offline
        fantasy1215
        wrote on last edited by
        #3

        To Hamid: for the edit control is created dynamicly, we may asign an ID for this edit control using #define LVS_EDIT_ID 5100 m_pctlEdit = new CEdit; m_pctlEdit->Create(xxx, **LVS_EDIT_ID**); If we send a message to the edit control(NOT FAMILAR TO SendMessage too), The edit control how to deal with this message, and where is the code? I'm very poor at SDK programming way.

        1 Reply Last reply
        0
        • M mwolf122

          hallo, in order to display and change a date list written in a txt file, seveal CEdit and CSpinCtrl should be dynamic created. The amount for the set of Editbox and SpinCtrl should be dynamic decided, according to the count of date set. CSpinCtrl and CEdit has the same behavior. I cant set the Message using ClassWizard, How can I dynamic set the Message for the CEdit and CspinCtrl? I have tried, in the Class, a Message Map UDN_DELTAPOS (ID, OnEditChange()). I set all the CSpinCtrl with the same ID. In this way, when any CspinCtrl changes, the function OnEditChange() will be called, but i can not recognize which one has been clicked. does anyone who has a solution? thanks ;) mwolf

          M Offline
          M Offline
          mwolf122
          wrote on last edited by
          #4

          to Hamid, unfortunately, i havent got sendmessage in the link you gave. I can assign a ID and a function before the CEdit is created, and use UDN_DELTAPOS (ID, OnEditChange(). then by creating the CEdit, I can set the same ID for the CEdit. the problem is, before the programm running, i cant decide how many CEdit should be created, so I have no idea how many IDs should be assigned in my program.

          H 2 Replies Last reply
          0
          • M mwolf122

            to Hamid, unfortunately, i havent got sendmessage in the link you gave. I can assign a ID and a function before the CEdit is created, and use UDN_DELTAPOS (ID, OnEditChange(). then by creating the CEdit, I can set the same ID for the CEdit. the problem is, before the programm running, i cant decide how many CEdit should be created, so I have no idea how many IDs should be assigned in my program.

            H Offline
            H Offline
            Hamid Taebi
            wrote on last edited by
            #5

            I didnt understand what you siad you make a dynamic control now do you want to know where you must send messagess to it?

            1 Reply Last reply
            0
            • M mwolf122

              to Hamid, unfortunately, i havent got sendmessage in the link you gave. I can assign a ID and a function before the CEdit is created, and use UDN_DELTAPOS (ID, OnEditChange(). then by creating the CEdit, I can set the same ID for the CEdit. the problem is, before the programm running, i cant decide how many CEdit should be created, so I have no idea how many IDs should be assigned in my program.

              H Offline
              H Offline
              Hamid Taebi
              wrote on last edited by
              #6

              Do you want to make edit controls with user select why you dont use of a int variable I had worked before but I think its possible that you use of them.

              1 Reply Last reply
              0
              Reply
              • Reply as topic
              Log in to reply
              • Oldest to Newest
              • Newest to Oldest
              • Most Votes


              • Login

              • Don't have an account? Register

              • Login or register to search.
              • First post
                Last post
              0
              • Categories
              • Recent
              • Tags
              • Popular
              • World
              • Users
              • Groups