Clear selection Combobox

I have a drop-down list with values โ€‹โ€‹that, when selected, lead to other questions.

I have a button that I want to use as a "One Level Up" button, which removes all of the following questions. You should reset the display of the combo box to zero, as before any options were selected so that the user can make a choice.

I tried to set value = 0, ListIndex = -1.

I do not want to use "Clear" because I want to save the values โ€‹โ€‹in the drop-down list.

I looked at the properties of the combo box and canโ€™t choose which one will do what I want.

+7
source share
4 answers
Listbox.Value=null 

gotta do the trick.

+6
source

If you use: ComboBox1.ListIndex = -1 without list items, there will be no effect. This is a problem if you are dynamically loading items. Use: ComboBox1.Value = Null to clear the value as above.

+2
source

ComboBox1 **. Clear ** is probably the easiest way

0
source

I ran into the same problem, and maybe we have the same scenario.

I understand that you do not want to run the clear method and make the current listed elements disappear, but just make the combo useless.

If before trying to make the combo value empty or empty ("") or ListIndex = -1, you re-populated the combo with a new set of elements, this can happen. Before re-filling the combo box with new items, you must call the clear method, and then re-populating the combo box with new items and then set the value to zero or the value of an empty string ("").

0
source

All Articles