title: How to access controls that is in the panel in c#
body: <p>I use a panel in c# winforms and fill the panel with the no of picture box using loop</p>
  
  <p>For example, panel name is panal</p>
  
  <pre><code>foreach (string s in fileNames)
  {            
      PictureBox pbox = new new PictureBox();
      pBox.Image = Image.FromFile(s);
      pbox.Location = new point(10,15);
      .
      .
      .
      .
      this.panal.Controls.Add(pBox);
  }
  </code></pre>
  
  <p>now I want to change the location of picturebox in another method. 
  The problem is that how can now I access the pictureboxes so that I change the location of them.
  I try to use the following but it is not the success.</p>
  
  <pre><code>foreach (Control p in panal.Controls)
                  if (p.GetType == PictureBox)
                     p.Location.X = 50;
  </code></pre>
  
  <p>But there is an error. The error is:</p>
  
  <pre><code>System.Windows.Forms.PictureBox' is a 'type' but is used like a 'variable'
  </code></pre>