Hello,
Try This:
private void Form1_Load(object sender, EventArgs e)
{
comboBox1.Items.AddRange(new string[] { "A", "B", "C" });
comboBox1.SelectedIndex = -1;
comboBox2.Items.Clear();
}
private void comboBox1_SelectedIndexChanged(object sender, EventArgs e)
{
comboBox2.Items.Clear();
switch (comboBox1.SelectedItem.ToString())
{
case "A":
comboBox2.Items.AddRange(new string[] { "1", "2", "3" });
break;
case "B":
comboBox2.Items.AddRange(new string[] { "3", "4"});
break;
case "C":
comboBox2.Items.AddRange(new string[] { "5", "6" });
break;
default:
break;
}
comboBox2.SelectedIndex = -1;
}
Att.
Ernesto Fazolo