C# add controls to my form

Asked

Viewed 57 times

1

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

1 answer

2

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

See if it works ^^

  • That’s right, thanks! I’ll add other options default tb, vlwzao

Browser other questions tagged

You are not signed in. Login or sign up in order to post.