读书人

在一个form中怎么动态的增加textbox

发布时间: 2012-06-14 16:00:31 作者: rapoo

在一个form中如何动态的增加textbox?
在一form中有一button,点button,就增加textbox,如何实现,请各位大侠指点一下!
谢谢!

[解决办法]

C# code
        private void button1_Click(object sender, EventArgs e)        {            TextBox tbox = new TextBox();            tbox.Text = "add";            tbox.Location = new Point(30, 50);            this.Controls.Add(tbox);        }
[解决办法]
private void button1_Click(object sender, EventArgs e)
{
TextBox tb = new TextBox();
tb.Height = 50;
tb.Width = 100;
tb.Location = new Point(100, 100);
this.Controls.Add(tb);
}
[解决办法]
探讨
C# code

private void button1_Click(object sender, EventArgs e)
{
TextBox tbox = new TextBox();
tbox.Text = "add";
tbox.Location = new Point(3……

读书人网 >C#

热点推荐