I use a panel in c# winforms and fill the panel with the no of picture box using loop. like this eg panel name is panal
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);
}
now i want to change the location of picturebox in anothe mathd. The problem is that how can now i access the pictureboxes so that i change the location of them. i try to use the followin but it is not success.
foreach (Control p in panal.Controls)
if (p.GetType == PictureBox)
p.Location.X = 50;
But there is error. The error is:
System.Windows.Forms.PictureBox' is a 'type' but is used like a 'variable'
Plz help!