lynxAi
Member
See title, I have 52 Picturebox controls, How to batch add pictures to these 52 Pictureboxes?
int Num = 0;
PictureBox[] pb;
Num = 52;
pb = new PictureBox[Num];
for (int i = 1; i < Num; i++)
{
pb[i] = new System.Windows.Forms.PictureBox();
pb[i].BorderStyle = BorderStyle.FixedSingle;
pb[i].Location = new Point(50 + i * 110, 100);
pb[i].SizeMode = PictureBoxSizeMode.Zoom;
pb[i].Image = Image.FromFile(@"D:\pic\" + i + ".png");
FlowPanel1.Controls.Add(pb[i]);
}
Load
event and put your code in the event handler.Image
property of the existing controls in your code.FlowLayoutPanel
is that it will handle the layout for you. You're not supposed to be setting the Location
property, as you were told previously?