Q: How CCheckListBox notifies "checkbox status changed"?
A: When the user changes a checkbox status in a CCheckListBox, an undocumented MFC-specific message is sent to parent window: CLBN_CHKCHANGE.
We can handle this message like in the following example:
Code:// MyDialog.h class CMyDialog : public CDialog { // ... afx_msg void OnCheckChangeMyList(); };Note: instead of ON_CONTROL, we can directly use ON_CLBN_CHKCHANGE macro.Code:// MyDialog.cpp // ... ON_CONTROL(CLBN_CHKCHANGE, IDC_MY_LIST, OnCheckChangeMyList) END_MESSAGE_MAP() void CMyDialog::OnCheckChangeMyList() { // got it! }
See alsoCode:// ... ON_CLBN_CHKCHANGE(IDC_MY_LIST, OnCheckChangeMyList) // ...


Ovidiu Cucu
Reply With Quote
Bookmarks