dynamically create cbutton
-
In my application a variable number of buttons (MFC CButton) are dynamically created. How to dynamically assign callback (OnClick) functions to these buttons? Can someone help me? Best regards, Peter de Hon
P e t e r wrote:
In my application a variable number of buttons (MFC CButton) are dynamically created.
There, you must have specified button Id's for those button, use that id and provide function handler in message map.
#define IDC_BUTTON_1 1 //define id
//creation code
button.Create(...,IDC_BUTTON_1);//dynamically created buttonBEGIN_MESSAGE_MAP(CMyDlg, CDialog)
ON_BN_CLICKED(IDC_BUTTON_1, OnClickButton1)//handler
END_MESSAGE_MAP()Prasad Notifier using ATL | Operator new[],delete[][^]
-
In my application a variable number of buttons (MFC CButton) are dynamically created. How to dynamically assign callback (OnClick) functions to these buttons? Can someone help me? Best regards, Peter de Hon