Advertisement
Guest User

Untitled

a guest
Jan 22nd, 2019
226
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.87 KB | None | 0 0
  1.   List<CheckBox> checkBoxes = new List<CheckBox>();
  2.             checkBoxes.Add(checkBox1);
  3.             checkBoxes.Add(checkBox2);
  4.             checkBoxes.Add(checkBox3);
  5.             checkBoxes.Add(checkBox4);
  6.             foreach (var c in checkBoxes)
  7.             {
  8.                 if (c is CheckBox)
  9.                 {
  10.                     CheckBox chk = (CheckBox)c;
  11.  
  12.                     if (chk.Checked)
  13.                     {
  14.                         literyDoUczenia.ListOfInput.Add(1);
  15.                     }
  16.                     else
  17.                     {
  18.                         literyDoUczenia.ListOfInput.Add(0);
  19.                     }
  20.                 }
  21.             }
  22.  
  23.             MessageBox.Show(literyDoUczenia.ListOfInput[1] + "");
  24.             MessageBox.Show(literyDoUczenia.ListOfInput[2] + "");
  25.             MessageBox.Show(literyDoUczenia.ListOfInput[3] + "");
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement