C # add controls to my form

1

How do I dynamically add controls to my form? During the program depending on what happens I would like controls (button, textbox) to be added to my program.

    
asked by anonymous 13.03.2017 / 20:20

1 answer

2
TextBox t1 = new TextBox();
t1.Location = new Point(10, 10);
t1.Text = "Olá Mundo!";
this.Controls.Add(t1);

See if it worked ^^

    
13.03.2017 / 20:22