Click here to Skip to main content
15,891,136 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
How i can change font size and font of string to Bold and i attached to stringBuilder


EX:

string strname="welcome"
stringBuilder strsb=new stringBuilder();

strsb.append(strname);


i want to change welcome text font size to 18Px,
and to Bold

how it is possible.

If any Know i appreciate .

Thanks&Regards

Venkat
Posted
Comments
Sergey Alexandrovich Kryukov 11-Jul-11 22:08pm    
Strings do not have font properties, isn't that clear?
--SA

You don't change the string itself. Instead, you change the control that's displaying the string.

C#
Label1.Text = myString;
Label1.Font = new Font(Label1.Font.Name, 18, Label1.Font.Style & FontStyle.Bold, Label1.Font.Unit);


Keep in mind that doing this in WPF/Silverlight will be different.
 
Share this answer
 
 
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