i have 3 list boxes. L1,L2,L3.
the contents are filled from DB. when i select third field in L1, the third fileds in L2 AND L3 SHOULD BE HIGHLIGHTED. tht means if i select any field in L1, corresponding field in L2 and L3 shud be highlighted. highlighted fields index of all list boxes must be same. can some one help me with code please
List box selection help
4 Answers
Know the answer? Post it. Somebody with the same question will find it here.

Vimal KandasamyRank #2,151 · 661 reputationPosted Feb 24, 2009, 1:43 AM EST
its very simple...
after add items in three list boxes,
add the following code in listbox1-SelectedIndexChanged event method.
code in c#:
private void listbox1_SelectedIndexChanged(object sender,EventArgs e)
{
listBox2.SelectedIndex=listBox1.SelectedIndex;
listBox3.SelectedIndex=listBox1.SelectedIndex;
}
try this...
sairam73 reputationPosted Feb 24, 2009, 4:43 AM EST
Hi vimal,
Thanks for the Reply. I am getting this error when i run the program.
InvalidArgument=Value of '0' is not valid for 'SelectedIndex'. Parameter name: SelectedIndex
Vimal KandasamyRank #2,151 · 661 reputationPosted Feb 25, 2009, 2:23 AM EST
Make sure all three list boxes are contains same no of items and values... plz show your code.. then only i can identify your error...
sairam73 reputationPosted Feb 25, 2009, 8:22 AM EST
I got it Vimal. Thanks a ton. If possible can u please check my other question posted in same forum.
Thanks a ton once again