日期:2014-05-17 浏览次数:20803 次
private void frmMain_Load(object sender, EventArgs e)
{
for (int i = 0; i < 8; i++)
{
Label lab = new Label();
lab.Name = Name + i;
lab.Location = new Point(12, 42 + i * 30);
lab.Text = RandomNumber().ToString();
this.groupBox1.Controls.Add(lab);//这里打断点每次执行完后又不一样,但去掉断点又是一样了.不解.
}
}
public int RandomNumber()
{
Random seed = new Random();
return seed.Next(1, 99);
}
Random seed = new Random();
public int RandomNumber()
{
return seed.Next(1, 99);
}