Advertisement
ntamas

listbox elemeinek szinkron kiválasztása

Nov 7th, 2014
185
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.56 KB | None | 0 0
  1.     private void listBox1_SelectedIndexChanged(object sender, EventArgs e)
  2.     {
  3.       index1 = listBox1.SelectedIndex;
  4.       if (index1 > -1)
  5.       {
  6.         if (!listBox2.GetSelected(index1))
  7.         {
  8.           listBox2.SetSelected(index1, true);
  9.         }
  10.       }
  11.     }
  12.  
  13.     private void listBox2_SelectedIndexChanged(object sender, EventArgs e)
  14.     {
  15.       index2 = listBox2.SelectedIndex;
  16.       if (index2 > -1)
  17.       {
  18.         if (!listBox1.GetSelected(index2))
  19.         {
  20.           listBox1.SetSelected(index2, true);
  21.         }
  22.       }
  23.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement