When i click a button , a text box is created in the widows form
and how to change the color of text which is in the text.by the way How to change the font of the text in text box?
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Joe WilsonPosted Jun 28, 2014, 9:35 AM
Princy GuptaPosted Jun 27, 2014, 6:33 AM
hope the below code helps
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);
}
to change the border color you would have to create your own textbox and override OnPaint