title: how to use loops to access form elements in C#?
body: <pre><code>  if(pictureBox1.Tag.ToString() == "accept")
          {
              char room1 = Convert.ToChar(lbl_roomid1.Text);
              row1[13] = (byte)room1;
  
              DateTime sdt1 = DateTime.Parse(txt_sdate1.Text);
              //some code
           }
    if (pictureBox2.Tag.ToString() == "accept")
          {
              char room2 = Convert.ToChar(lbl_roomid2.Text);
              row1[13] = (byte)room2;
  
              DateTime sdt1 = DateTime.Parse(txt_sdate2.Text);
              //some code
           }
  </code></pre>
  
  <p>/* What if i wanted to type this code inside a loop?? i need to do the same for 10 pictureboxes */</p>