how can i set message map for dynamic created CEdit [modified]
-
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
-
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
See these messages for Editbox and for send you can use of SendMessage.Edit Boxes Messages[^]
-
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
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. -
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
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.
-
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.
I didnt understand what you siad you make a dynamic control now do you want to know where you must send messagess to it?
-
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.
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.