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 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);
}


VulpesRank #55 · 29.2K reputationPosted Jun 29, 2014, 4:02 PM EDT
Joe WilsonRank #631 · 3.8K reputationPosted Jun 29, 2014, 9:10 PM EDT
Thank you very Much.
VulpesRank #55 · 29.2K reputationPosted Jun 30, 2014, 1:37 AM EDT
public Form1()
{
InitializeComponent();
btnGetFullName.Click += btnGetFullName_Click;
}