问题
I'm dealing with the fact that when I clear items in a combobox programmatically, the text do not change and keep the last selected item.
How can I do it?
回答1:
Try
comboBox.SelectedIndex = -1;
Or
comboBox.Items.Clear();
comboBox.ResetText();
回答2:
Another way for combo boxes:
Populate
comboBox1.DataSource = new string[] { "", "bruce", "clark", "tony" };
Clear
comboBox1.DataSource = null;
来源:https://stackoverflow.com/questions/37525422/combobox-text-when-clearing-items