Reputation: 10913
If for textbox it is textbox1.clear
, etc.
What is the equivalent for combobox to clear the value.
Upvotes: 8
Views: 89860
Reputation: 615
first null the the datasource
combobox.DataSource = Nothing
then clear the combobox combobox.Items.Clear()
Upvotes: 0
Reputation: 135
To clear the items that are in the drop down menu combobox.SelectedIndex = -1
will work.
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.
Upvotes: 0
Reputation: 41
If your combobox
is set with the DropDownList
, then
use Combobox1.SelectedIndex = -1
Upvotes: 4