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

VulpesPosted Jun 30, 2014, 5:37 AM
public Form1()
{
InitializeComponent();
btnGetFullName.Click += btnGetFullName_Click;
}
Joe WilsonPosted Jun 30, 2014, 1:10 AM
Thank you very Much.
VulpesPosted Jun 29, 2014, 8:02 PM