I have a combobox with values that when selected, lead to other questions.
I have a button that I want to be an "Up one level" button that clears all the following questions. It should reset the display of of the combobox to nothing, like before any options were selected, so the user can make a selection.
I tried setting the Value = 0, the ListIndex = -1.
I don't want to use "Clear" because I want to preserve the values in the combobox.
I looked through the properties of a combobox and I can't pick out which one will do what I want.
To remove an itemCall the Remove or RemoveAt method to delete items. Remove has one argument that specifies the item to remove. RemoveAt removes the item with the specified index number.
To clear what the user types in the combobox combobox. Text = String. Empty will work because the combobox also has a text property. Use both of these to ensure it will clear the fields.
You can create a combobox widget by initializing the constructor of Combobox(root, width, text) widget. Consider the case, if the user wants to clear the selected value from the combobox widget, the only way you can do so is to set the value of the combobox widget as NULL by using the set (' ') method.
If you use: ComboBox1.ListIndex = -1
with no list items then there will be no effect. This is a problem if you're dynamically loading the items. Use: ComboBox1.Value = Null
to clear the value as mentioned above.
Listbox.Value=null
should do the trick.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With