CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 8 of 8
  1. #1
    Join Date
    Aug 2005
    Posts
    8

    [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

  2. #2
    Join Date
    May 2004
    Location
    Pell City, Alabama
    Posts
    126

    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 .

  3. #3
    Join Date
    Aug 2005
    Posts
    8

    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 .

  4. #4
    Join Date
    May 2004
    Location
    Pell City, Alabama
    Posts
    126

    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.

  5. #5
    Join Date
    Aug 2005
    Posts
    8

    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

  6. #6
    Join Date
    May 1999
    Location
    ALABAMA, USA
    Posts
    9,917

    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
    There are only 10 types of people in the world:
    Those who understand binary and those who do not.

  7. #7
    Join Date
    Aug 2005
    Posts
    8

    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

  8. #8
    Join Date
    Aug 2005
    Posts
    8

    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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured