SelectedItem/SelectedIndex in DropDown ComboBox

  • Thread starter Thread starter O.B.
  • Start date Start date
O

O.B.

I have a ComboBox as a DropDown list. The following code is executed
in the form's constructor.

dropDownComboBox.Items.Add("ALL");

The following does nothing.

dropDownComboBox.SelectedItem = 0;

The following also does nothing.

dropDownComboBox.SelectedIndex = 0;

Help?
 
try
dropDownComboBox.ClearSelection();
dropDownComboBox.Items[0].Selected = true;
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Back
Top