int i=0;
private void button5_Click(object sender, EventArgs e)
{
tb.Name = "tb_"+i.Tostring();
tb.Text =(i+2).Tostring() ;
tb.Width = 200;
tb.Height = 30;
tb.Location = new Point(0,0+i*30);
i++;
this.panel1.Controls.Add(tb);
}
}
我试了下面的代码是可以的:
int i = 0;我知道是什么原因了! 谢谢