日期:2014-05-18  浏览次数:21338 次

在一个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……