flowLayoutPanel中添加控件

循环向flowLayoutPanel中添加控件
while(int i=0;i<10;i++)
{
PictureBox picture = new PictureBox();
picture.Image = this.imageList1.Images[i];
picture.Tag = i;
this.flowLayoutPanel1.Controls.Add(picture);
}
之后我想更改某个(比如第2个)PictureBox的图片,更改

((PictureBox)this.flowLayoutPanel1.Controls[2]).Image = ...

你可能感兴趣的:(layout)