11智能在线
新记
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);
}本回答被提问者采纳
相似回答
大家正在搜
相关问题
C#动态添加控件 textbox
C# 在panel 上动态添加自定义控件textbox,为什...
c#动态生成的textbox如何赋值
C#怎么给动态生成的控件(Textbox)赋值。
c# 中怎样用代码往窗体里加入文本框
求:在c# 应用程序中动态生成的textbox怎样获取值,以...
C#winform怎么将动态添加的textbox控件中的值(...