Hi Brett,
As Dave more or less pointed out, use the Text property to manipulate the
Text field of the ComboBox.
mycbox.Text = ""; // or String.Empty or null
should work.
When you do a Clear on the ComboBox you already clear SelectedText and
SelectedValue as well. SelectedIndex is set to -1 to indicate no item is
selected. The Text property is cleared as well if the ComboBox style is
set to DropDownList, but a regular ComboBox allows for manual editing of
the Text property and will therefore not be cleared even if the items are
removed.
On Tue, 31 Oct 2006 02:16:39 +0100, Brett Romero <ac*****@cygen.comwrote:
After I remove all items from a combobox, the last selected item
remains in the display area. I've tried:
mycbox.SelectedText = string.Empty;
and
mycbox.refresh();
How do I clear the display area of a combobox after removing all of its
items?
Thanks,
Brett
--
Happy Coding!
Morten Wennevik [C# MVP]