C#(Winform)怎么删除TextBox控件(不是隐藏)!!
这段代码能循环生成5个TextBox控件~删除我不会~大家帮忙写一个方法!循环移除(不是隐藏)控件!publicvoidaddtxt(intn){TextBox[]txt...
这段代码能循环生成5个TextBox控件~删除我不会~大家帮忙写一个方法!循环移除(不是隐藏)控件!
public void addtxt(int n)
{
TextBox[] txt = new TextBox[5];
for (int i = 0; i < 5; i++)
{
txt[i] = new TextBox();
txt[i].Name = txt + i.ToString();
txt[i].Text = "";
txt[i].Location = new Point(48 + 30 * i, 64 + 30 * i);
txt[i].Size = new Size(50, 16);
Controls.Add(txt[i]);
}
} 展开
public void addtxt(int n)
{
TextBox[] txt = new TextBox[5];
for (int i = 0; i < 5; i++)
{
txt[i] = new TextBox();
txt[i].Name = txt + i.ToString();
txt[i].Text = "";
txt[i].Location = new Point(48 + 30 * i, 64 + 30 * i);
txt[i].Size = new Size(50, 16);
Controls.Add(txt[i]);
}
} 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询