Joe Wilson

Joe Wilson

  • NA
  • 7.8k
  • 435.2k

What is the problem of adding textbox to windows form?

Jun 29 2014 3:28 PM

 I used this code to add a text box to windows form by button

but it doesn't work what is the code problem?
 
 
private void btnGetFullName_Click(object sender, EventArgs e)
{
TextBox textbox_1 = new TextBox();
textbox_1.Text = "New TextBox";
System.Drawing.Font font = new Font("Arial", 8, FontStyle.Bold);
textbox_1.BorderStyle = BorderStyle.FixedSingle;
textbox_1.BackColor = Color.White;

textbox_1.Font = font;
this.Controls.Add(textbox_1);

}



Answers (3)