日期:2014-05-17 浏览次数:21068 次
private void listBox1_SelectedIndexChanged(object sender, EventArgs e)
{
if (listBox1.Focused)
{
listBox2.SelectedIndices.Clear();
for (int i = 0; i < listBox1.SelectedIndices.Count; i++ )
{
listBox2.SelectedIndices.Add(listBox1.SelectedIndices[i]);
}
}
}
private void listBox2_SelectedIndexChanged(object sender, EventArgs e)
{
if (listBox2.Focused)
{
listBox1.SelectedIndices.Clear();
for (int i = 0; i < listBox2.SelectedIndices.Count; i++)
{
listBox1.SelectedIndices.Add(listBox2.SelectedIndices[i]);