Click here to Skip to main content
15,894,017 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hi all,
i create a button at runtime. i want to change it font style. how could i do that.
thanx in advance
neaS
Posted

Hi neeraj by applying the attribute to button you can run time change the font of your button.
 
Share this answer
 
Hi,
You can try the following code ...

Point p = new Point(50, 50);
Button b = new Button();
System.Drawing.FontFamily fm = new FontFamily("Arial Narrow");
Font f = new System.Drawing.Font(fm,20 ,FontStyle.Italic);
b.ForeColor = Color.Red;
b.Text = "Click Me!!";
b.Location = p;
b.Font = f;


Thanks
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900