title: Multiple checking of checkboxes (for statement)
body: <p>i recently got into coding i'm a first year IT student.
  my prof give us a project where we should create any kind of management system and i pick the fast food type one.</p>
  
  <p>i stumbled in some problem while making a checkout function.
  I have this multiple picture boxes with individual check boxes i made a function that whenever the user clicked the picture box the checkbox will be checked.
  <a href="https://i.stack.imgur.com/mk8Wh.png" rel="nofollow noreferrer">my proj currently</a></p>
  
  <p>the problem I'am having is i want to take all the data(text) of checked boxes with if statement but it would be so tedious because i have like 15 picture boxes with checkbox.
  is there any simpler way to do this with for statement? or anything just to shorten my code.</p>
  
  <p><strong><em>this is my current code</em></strong>.</p>
  
  <pre><code>private void button1_Click(object sender, EventArgs e)
      {
          string food1 = "";
          string food2 = "";
          //...........................food15
  
          if (checkBox1.Checked)
          {
              food1 = checkBox1.Text;
          }
          if (checkBox2.Checked)
          {
              food2 = checkBox2.Text;
          }
          //.............................................checkbox15
          if (food1 != "" || food2 != "")
          {
              MessageBox.Show(food1 + food2);
          }
          else
          {
              MessageBox.Show("Pick something ");
          }
      }
  </code></pre>