I have three listBoxes:
listBox1 have the following items: Fruit and vegetable.
listBox2 have the following items: Orange, Apple, cucumber and Tomato.
li
you can try
listBox1_SelectedIndexChanged(obj ... , sender e)
{
if(listBox1.SelectedItem.ToString() == "Fruit")
{
listBox2.Items.Add("Orange");
listBox2.Items.Add("Apple");
}
else if()
{
// other conditons
}
}
listBox2_SelectedIndexChanged(obj ... , sender e)
{
if(listBox2.SelectedItem.ToString() == "Apple")
{
listBox3.Items.Add("Red");
listBox3.Items.Add("Green ");
........
}
else if()
{
// other conditons
}
}
read http://msdn.microsoft.com/en-us/library/system.windows.forms.listbox.selectedindexchanged.aspx