[RESOLVED] CComboBoxEx - Droplist
Hello,
I am trying to use a CComboBoxEx with the Droplist type. I have added a message map handler for ON_CBN_SELCHANGE to handle a selection change, however my handler is never being called. If I change the type to Dropdown it is working properly.
Can anyone tell me how to handle selection changes for a Droplist type CComboBoxEx?
Thanks,
Jen
Re: CComboBoxEx - Droplist
The reason its not working is because the CComboBoxEx uses a notify handler, not a regular Combo box CBN_SELCHANGE. The message you want to handle is a CBEN_BEGINEDIT .
Re: CComboBoxEx - Droplist
I have also tried CBEN_BEGINEDIT with the same result: it works with Dropdown, but not with Drop List.
Jen
Quote:
Originally Posted by Mutilated1
The reason its not working is because the CComboBoxEx uses a notify handler, not a regular Combo box CBN_SELCHANGE. The message you want to handle is a CBEN_BEGINEDIT .
Re: CComboBoxEx - Droplist
Its a notification message so unless you are reflecting the message back to the control, it is the parent that is being notified not the control, which I suspect is why you don't get the message.
Re: CComboBoxEx - Droplist
But I am handling the message with the parent window, I have not subclassed the CComboBoxEx. That also does not explain why it would work when the type is Dropdown type but not when it is Drop List.
Thanks for your replies,
Jen
Re: CComboBoxEx - Droplist
Quote:
Originally Posted by jeh
If I change the type to Dropdown it is working properly.
That should not be a case. Create new default application, do not change anything and try to handle the same message changing combo style. See if it behaves differently than
Re: CComboBoxEx - Droplist
Quote:
Originally Posted by JohnCz
That should not be a case. Create new default application, do not change anything and try to handle the same message changing combo style. See if it behaves differently than
It seems you are correct, in the basic application it is working properly. Thank you, at least now I have something to compare to.
Jen
Re: CComboBoxEx - Droplist
Thank you all for you help. I am embarrassed to say that the problem was with the resource id. There was a range of ids preceding the one selected for the combo box that was reserved for a custom control. It turns out I had an off by one error, and the id of the combo box should have been included in that reserved range.
Jen