Advertisement
ntamas

áthelyező gomb

Mar 25th, 2014
129
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.50 KB | None | 0 0
  1.     private void button7_Click(object sender, EventArgs e)
  2.         {
  3.             int szam;
  4.             for (int i = 0; i < listBox1.Items.Count; i++)
  5.             {
  6.                 szam = Convert.ToInt32(listBox1.Items[i]);
  7.                 if(szam % 2 == 0)
  8.                 {
  9.                     listBox2.Items.Add(szam);
  10.                 }
  11.                 else
  12.                 {
  13.                     listBox3.Items.Add(szam);
  14.                 }
  15.             }
  16.             listBox1.Items.Clear();
  17.         }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement