Click here to Skip to main content
14,454,836 members
Rate this:
Please Sign up or sign in to vote.
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
Rate this:
Please Sign up or sign in to vote.

Solution 2

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

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.
   
Rate this:
Please Sign up or sign in to vote.

Solution 1

   

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




CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100