c#动态添加textBox代码怎么写

c#动态添加textBox代码怎么写

第1个回答  推荐于2016-06-05
public void CreateTextBox()
{
//创建一个新box
TextBox textBox1 = new TextBox();
// 在box里面添加字
textBox1.Text = "Hello there!";
}
第2个回答  2009-12-11
//如果是winform的话
private void button1_Click(object sender, EventArgs e)
{
TextBox t1 = new TextBox();
this.Controls.Add(t1);
}本回答被提问者采纳
相似回答