How do I clear a combobox?

Fuzz Evans picture Fuzz Evans · Feb 17, 2012 · Viewed 246k times · Source

I have some combo-boxes that are set up as drop down lists, and the user can pick a number in them. I also have a Clear button that should clear the text from the combo boxes but I can't seem to get it. I've tried:

 //doesn't work
 cboxHour.Text = "";

and

//doesn't work
cboxHour.ResetText();

This seems like it should be so straight forward but I'm just not getting it.

Answer

Daniel Mann picture Daniel Mann · Feb 17, 2012

Did you try cboxHour.Items.Clear()?