Problem trying to clear text from combo box in dropdownlist mode
Posted on 2005-05-06
I'm having issues trying to clear the text from a combo box when I am using dropdownlist comboboxstyle.
Here is what I'm trying to do: this works in my test app, but not in my real app. I have EnabledVisualStyles in both apps:
Dim style As ComboBoxStyle = cmb.DropDownStyle
cmb.DropDownStyle = ComboBoxStyle.DropDown
cmb.SelectedItem = Nothing
cmb.Text = ""
cmb.DropDownStyle = style
This code works in one app, but not the other. in the non-working app, the cmb.Text and cmb.SelectedItem fields are properly set to "" and nothing respectively, but when calling cmb.DropDownstyle = style, the text and selected item change back to their previously held values.