在c# 里面怎么给一个textbox控件自动编号 比如说从1000开始 然后递增1
2个回答
展开全部
for(int index = 1000;index<1002;index++){
TextBox index= new TextBox ();
index.Size = new Size(Width,Height);
index.AutoSize = false;
index.BackColor = Color.Yellow;
index.BorderStyle = BorderStyle.FixedSingle;
index.Location = new Point(X,Y);
this.Controls.Add(index);
}
或者
this.Controls.Find(要找的控件) as List<控件>; 遍历给属性赋值
TextBox index= new TextBox ();
index.Size = new Size(Width,Height);
index.AutoSize = false;
index.BackColor = Color.Yellow;
index.BorderStyle = BorderStyle.FixedSingle;
index.Location = new Point(X,Y);
this.Controls.Add(index);
}
或者
this.Controls.Find(要找的控件) as List<控件>; 遍历给属性赋值
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询