110,538
社区成员
发帖
与我相关
我的任务
分享
int ran;
for (int i = 1; i < 10; i++)
{
for (int j = 1; j < 10; j++)
{
ran= ren.Next(0,12);
Button but = new Button();
but.Location = new Point((j * 40), i * 40);
but.Size = new Size(40, 40);
but.Tag = ren;
but.Image = imageList1.Images[ran];
but.FlatStyle = FlatStyle.Flat;
but.Click += new EventHandler(but_Click);
this.Controls.Add(but);
}
}