Combobox datasource has been assigned with
cmbCombobox.DataSource = myCollection
where myCollection has type MyCollection: List
How can I clear items in combobox?
When you data bind a control, it will synchronize with that collection. In order to clear the items in your ComboBox set it's DataSource to null.
cmbComboBox.DataSource = null;
If your combobox is not databound (no DataSource) then you can do
cmbComboBox.Items.Clear();
http://support.microsoft.com/kb/327895
Me.ListBox1.DataSource = Nothing
This works for me. VB incorrectly advises the use of DBNull (which crashes).
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