CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 5 of 5
  1. #1
    Join Date
    May 2009
    Posts
    103

    How do you dropdown a Combo Box when clicked?

    I have a dropdown combo box on a dialog. Of course, clicking on the dropdown "arrow", the dropdown list opens as it should. If you click on the actual text in the dropdown BEFORE it dropsdown, the text just highlights. How can we force the combo to drop down (open) when the displayed text is clicked on?

    Thanks ahead of time....

  2. #2
    Join Date
    May 2004
    Location
    45,000FT Above Nevada
    Posts
    1,539

    Re: How do you dropdown a Combo Box when clicked?

    Trap for the CBN_SETFOCUS message then send a CB_SHOWDROPDOWN message to the combo box.
    Jim
    ATP BE400 CE500 (C550B-SPW) CE560XL MU300 CFI CFII

    "The speed of non working code is irrelevant"... Of course that is just my opinion, I could be wrong.

    "Nothing in the world can take the place of persistence. Talent will not; nothing is more common than unsuccessful men with talent. Genius will not; unrewarded genius is almost a proverb. Education will not; the world is full of educated derelicts. Persistence and determination are omnipotent. The slogan 'press on' has solved and always will solve the problems of the human race."...Calvin Coolidge 30th President of the USA.

  3. #3
    VictorN's Avatar
    VictorN is offline Super Moderator Power Poster
    Join Date
    Jan 2003
    Location
    Hanover Germany
    Posts
    20,396

    Re: How do you dropdown a Combo Box when clicked?

    ... or if MFC is used, the CComboBox::ShowDropDown can be used
    Victor Nijegorodov

  4. #4
    Join Date
    Nov 2000
    Location
    Voronezh, Russia
    Posts
    6,620

    Re: How do you dropdown a Combo Box when clicked?

    If you click on the actual text in the dropdown BEFORE it dropsdown, the text just highlights. How can we force the combo to drop down (open) when the displayed text is clicked on?
    This is normal behavior for Dropdown combo (CBS_DROPDOWN). You may try to change the combo style to Drop List (CBS_DROPDOWNLIST) unless you still need the text to remain selectable.

    Combo-Box Styles
    Best regards,
    Igor

  5. #5
    Join Date
    May 2009
    Posts
    103

    Re: How do you dropdown a Combo Box when clicked?

    Quote Originally Posted by Igor Vartanov View Post
    This is normal behavior for Dropdown combo (CBS_DROPDOWN). You may try to change the combo style to Drop List (CBS_DROPDOWNLIST) unless you still need the text to remain selectable.

    Combo-Box Styles
    Crap!! I didn't catch that!! That was it. Sometimes the obvious is overlooked. Thank You.

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