views:

28

answers:

2

I have an app written in C# for the compact framework (3.5).

I am trying to display some text on the form in bold.

The Label class does not give me the option to bold my text (I can make it bigger, which eventually gives a bold look, but I want my text 12pt and bold.

Is this possible? If so How?

thanks for any ideas.

+2  A: 

FontStyle should work for you

Label1.Font = new Font(Label1.Font, FontStyle.Bold);
Hun1Ahpu
Sweet! That worked. Kinda lame that I can't do that at design time. But run time is when it really matters.
Vaccano
The font isn't an option at design time? I'm pretty sure it is. But I think it is collapsed. You have to click the + and then you will see it.
Bryan
+2  A: 

You can do it designtime ;)

In visual studio you can extend the font property, to expose the name, font and style property. Also you can add ; style=bold after the font property in visual studio. (or any style for that matter).

If you keep using the code above, i recommend disposing the old font, to prevent a memory leak

Roy