title: Get checked state of dynamically added check boxes
body: <p>i added check boxes dynamically in a panel and after executing how can i get which check boxes are selected when a button is clicked.</p>
  
  <pre><code>public int x=550 ,y=10;
      private void Form1_Load(object sender, EventArgs e)
      {
  
          var panel1 = new Panel()
          {
              Size = new Size(600, 70),
              Location = new Point(20, 130),
              BorderStyle = BorderStyle.FixedSingle
          };
          for (int i = 0; i &lt; 20; i++)
          {
              CheckBox chkpremiumtickets = new CheckBox();
              chkpremiumtickets.Text = " ";
              chkpremiumtickets.Name = "chkboxpremiumtickets";
              chkpremiumtickets.Location = new Point(x,y);
              panel1.Controls.Add(chkpremiumtickets);
              x = x - 55;
              if (x &lt; 55)
              {
                  y = y+20;
                  x = 550;
              }
          }
  
          x = 550; y = 10;
  
          Controls.Add(panel1);
  </code></pre>