SHARE
TWEET

Untitled

a guest Dec 16th, 2018 70 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. int startLocation = 142;
  2. for (i = 0; i < ingridients.Length; i++)
  3. {
  4.     box = new CheckBox(); //Create new checkBox
  5.     box.Tag = i;//CheckBox (Tag 0-..)
  6.     box.TabIndex = 8 + i;//Последовательность "выбора" через TAB
  7.     box.Text = ingridients[i];
  8.     box.AutoSize = true;
  9.     box.Location = new Point(2, startLocation);
  10.         startLocation += 25;
  11.     this.Controls.Add(box);
  12. }
  13.    
  14. for (int n = 0; n<i; n++)
  15. {
  16.     if (box.Tag[n].Checked = true )
  17.     {
  18.  
  19.     }
  20. }
  21.    
  22. foreach (CheckBox chbox in this.Controls.OfType<CheckBox>())
  23. {
  24.     if (chbox.Checked) { /*...*/ }
  25. }
  26.    
  27. List<Checkbox> _chBoxLst = new List<Checkbox>();
  28. int startLocation = 142;
  29. for (i = 0; i < ingridients.Length; i++)
  30. {
  31.     _chBoxLst (new CheckBox()); //Create new checkBox
  32.     //дальше идентично твоему коду
  33. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top