Link to home
Start Free TrialLog in
Avatar of jjacksn
jjacksn

asked on

Problem trying to clear text from combo box in dropdownlist mode

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.Focus()
                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.  
ASKER CERTIFIED SOLUTION
Avatar of AlexFM
AlexFM

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial