C# 如何链接3个列表框

C# 如何链接3个列表框,c#,winforms,C#,Winforms,我有三个列表框,我想要的是,当我点击第一个列表框中的一个数字时,我想要相应的列也被高亮显示,我已经提供了我想要的图像 您可能需要设置其他列表框的SelectedIndex: private void listBox1_SelectedIndexChanged(object sender, EventArgs e) { var ndx = listBox1.SelectedIndex; listBox2.SelectedIndex = ndx; listBox3.Sele

我有三个列表框,我想要的是,当我点击第一个列表框中的一个数字时,我想要相应的列也被高亮显示,我已经提供了我想要的图像


您可能需要设置其他列表框的
SelectedIndex

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

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

您是否调查了
列表框
对象的属性?有一些可能对您有用。您可能正在查找
DataGridView
ListView