Reputation: 337
I have a class that derives CComboBox
and I want it to handle internally when the user selects another item. I know that I can catch the selection in the parent control with ON_CBN_SELCHANGE
, but I want to handle the selection change within the combobox itself, so that I can use the private implementation details of my own derived combobox class to interpret the new selection.
Is this possible and how I can I do this?
Upvotes: 1
Views: 581
Reputation: 1356
In header:
afx_msg LRESULT OnSelchange();
in cpp file:
BEGIN_MESSAGE_MAP(CComboBoxExt, CComboBox)
ON_CONTROL_REFLECT_EX(CBN_SELCHANGE, OnSelchange)
END_MESSAGE_MAP()
LRESULT CComboBoxExt::OnSelchange()
{
// TODO: Add your control notification handler code here
// do your job ...
return Default();
}
Upvotes: 2