Hello.
How can i set a default value for a combobox ?
i.e when form loads it be on it's default value.
* : I changed DropDownStyle property to DropDownList
Thank you :-)
Default value
1 Answer
Know the answer? Post it. Somebody with the same question will find it here.


Jaish MathewsRank #225 · 11K reputationPosted Aug 8, 2010, 4:01 AM EDT
You can use the SelectedIndex property for that
private void Form1_Load(object sender, EventArgs e)
{
string[] numbers = {"One","Two","Three","Select a Number" };
comboBox1.DataSource = numbers;
comboBox1.SelectedIndex = 3;
}