新手请教个动态添加label的问题
for (int i = 0; i < 5; i++){
int t=i+40;
int l=i+20;
Label lbl = new Label();
lbl.Name = "lbl" + i.ToString();
lbl.Text = "abc"+ i.ToString();
lbl.Location = new Point(10 + t,20 + l);
this.Controls.Add(lbl);
}
我想动态添加5个label,可是现在一运行就显示了一个 abc0,请问这是怎么回事啊?