重发一下爱代码,把无关的注释掉了。
注释内的语句为测试,使用picturebox控件,重复调用可以刷新。
private void card()
{
int i,j;
int[] N = new int[14]; f_sort(N, 13); //调用函数进行赋值 排序 /* Random d = new Random();
i = d.Next(imageList1.Images.Count);
Image img = this.imageList1.Images[i];
this.pictureBox1.Image = this.imageList1.Images[i];
// ShowpictureBoxArray();
PictureBox[] picBox = new PictureBox[14];
*/ for (i = 1; i < 14; i++)
{
picBox[i] = new PictureBox();
picBox[i].Name = "picBox";
picBox[i].Size = new System.Drawing.Size(80, 123); this.Controls.Add(picBox[i]); //在窗体上呈现控件
picBox[i].Location = new System.Drawing.Point(108 + 30 * i, 12);
j = N[i]; picBox[i].Image = this.imageList1.Images[j]; }
} private void button1_Click(object sender, EventArgs e)
{
card();
}
注释内的语句为测试,使用picturebox控件,重复调用可以刷新。
private void card()
{
int i,j;
int[] N = new int[14]; f_sort(N, 13); //调用函数进行赋值 排序 /* Random d = new Random();
i = d.Next(imageList1.Images.Count);
Image img = this.imageList1.Images[i];
this.pictureBox1.Image = this.imageList1.Images[i];
// ShowpictureBoxArray();
PictureBox[] picBox = new PictureBox[14];
*/ for (i = 1; i < 14; i++)
{
picBox[i] = new PictureBox();
picBox[i].Name = "picBox";
picBox[i].Size = new System.Drawing.Size(80, 123); this.Controls.Add(picBox[i]); //在窗体上呈现控件
picBox[i].Location = new System.Drawing.Point(108 + 30 * i, 12);
j = N[i]; picBox[i].Image = this.imageList1.Images[j]; }
} private void button1_Click(object sender, EventArgs e)
{
card();
}
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货