Pewis
Pewis

Reputation: 67

How to Link 3 List Boxes

I have three list boxes and what I want is to when I click on the one of the numbers in the first list box I want the corresponding columns to also be highlighted, I have provided images of what I want it to be like.

img

Upvotes: 0

Views: 70

Answers (1)

rjs123431
rjs123431

Reputation: 688

You may need to set the SelectedIndex of other listboxes:

private void listBox1_SelectedIndexChanged(object sender, EventArgs e)
{
    var ndx = listBox1.SelectedIndex;

    listBox2.SelectedIndex = ndx;
    listBox3.SelectedIndex = ndx;
}

Upvotes: 1

Related Questions