Combo box window text
-
Hello, I wish to have a combo box for which the window text is always the same. For example, the text of the combo box is "Select Widget". When the drop down button is clicked, a list of widgets should appear; after a widget is selected, the combo box should once again show the text "Select Widget", rather than displaying the selected widget. I have tried simply using SetWindowText on the CComboBox object, but that did not work. Might anyone have a bit of sample code doing this? Thanks
-
Hello, I wish to have a combo box for which the window text is always the same. For example, the text of the combo box is "Select Widget". When the drop down button is clicked, a list of widgets should appear; after a widget is selected, the combo box should once again show the text "Select Widget", rather than displaying the selected widget. I have tried simply using SetWindowText on the CComboBox object, but that did not work. Might anyone have a bit of sample code doing this? Thanks
[Shameless plug] You might want to consider using a FooButton[^] whose caption is "Select Widget". When the button is clicked, display your widget selection menu as described in the section "Displaying a popup menu". /ravi My new year's resolution: 2048 x 1536 Home | Articles | Freeware | Music ravib@ravib.com
-
Hello, I wish to have a combo box for which the window text is always the same. For example, the text of the combo box is "Select Widget". When the drop down button is clicked, a list of widgets should appear; after a widget is selected, the combo box should once again show the text "Select Widget", rather than displaying the selected widget. I have tried simply using SetWindowText on the CComboBox object, but that did not work. Might anyone have a bit of sample code doing this? Thanks
The combo box sends a change event message whenever someone makes a selection. If you override this message, you can then (a). handle that selection, then... (b) reset the selection to the 'Select Widget' text. Have a look at the various event messages sent from the class wizard to override.
I Dream of Absolute Zero
-
[Shameless plug] You might want to consider using a FooButton[^] whose caption is "Select Widget". When the button is clicked, display your widget selection menu as described in the section "Displaying a popup menu". /ravi My new year's resolution: 2048 x 1536 Home | Articles | Freeware | Music ravib@ravib.com
-
The combo box sends a change event message whenever someone makes a selection. If you override this message, you can then (a). handle that selection, then... (b) reset the selection to the 'Select Widget' text. Have a look at the various event messages sent from the class wizard to override.
I Dream of Absolute Zero