日期:2014-05-17 浏览次数:20885 次
private void button1_Click(object sender, EventArgs e)
{
for (int i = 0; i < 10; i++)
{
Panel pan = new Panel();
pan.Width = 150;
pan.Height = 150;
pan.BackColor = System.Drawing.Color.Yellow;
flowLayoutPanel1.Controls.Add(pan);
PictureBox pic = new PictureBox();
pic.Width = 150;
pic.Height = 130;
Image O_Image = Image.FromStream(WebRequest.Create("http://www.baidu.com/img/baidu_logo.gif").GetResponse().GetResponseStream());
pic.Image = O_Image;
pic.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage;
pan.Controls.Add(pic);
CheckBox chk2 = new CheckBox();
chk2.Width = 70;
chk2.Text = "test" + i.ToString(); chk2.Checked = (i % 1 == 0); chk2.Visible = true;
chk2.Top = 130;
chk2.Width = 13;