Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Combo box problem

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
I need to unselect an item on a combo box and I don't know how. Ie, I have a form with a combo box, when I pick something from the combo box list it'll appear on the combo box, now I'll have a reset button that should reset the selection of the combo box, ie there should be no selected item on it. How can I do this, is the only way to do it making combobox.Clear and then using AddItem function to fill it again? Or is there any function like Selection=none that will do this easier in terms of code?
 

You could do either:

combobox.text = ""

or

combobox.listindex = -1
 
A Combo box only selects one value so if you clear out the value of the combo box (cbocombo1.text = "") this should unmark the item.
 
Thanks SauerC the ListIndex works great. I couldn't set the text property to "" (I had allready tryed) because it's a read only property, but List Index works just the way I want to :)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top