strange behavior in Windows COMBOBOX

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • dorito
    New Member
    • Jun 2009
    • 18

    strange behavior in Windows COMBOBOX

    I have a COMBOBOX of style CBS_DROPDOWN .. i.e. the edit area is supposed to be editable. [And indeed it is editable by interactive typing into it]

    What I've noticed is that I can control the text shown in the edit area when I first create the COMBOBOX with SetWindowText (hwnd, "Hello There").

    However, after the user has selected an item from the drop down list, I can no longer do SetWindowText() to control the displayed text ... it seems to have no effect.

    Any ideas why this is so?

    [Yes, I know I can add the text I want to display temporarily to the list of strings in the drop down list, then display it by selecting its index, then remove it from the list ... but I'm trying to avoid all that overhead]

    Thanks
  • YarrOfDoom
    Recognized Expert Top Contributor
    • Aug 2007
    • 1243

    #2
    Have you tried clearing the current selection with CB_SETCURSEL?

    Comment

    • dorito
      New Member
      • Jun 2009
      • 18

      #3
      If I clear the current selection with CB_SETCURSEL -1 ... it indeed clears the edit box, but then a SetWindowText() call has no effect.

      Thx

      Comment

      Working...