A
Alexey Smirnov
How to make bold part of the text in a Windows.Forms.Label? Thank you.
How to make bold part of the text in a Windows.Forms.Label? Thank you.
Alexey,
You can create a new Font instance which has the FontStyle.Bold value
set and then set the Font property on the label class to that Font instance.
Hello Alexey,
If you need one part of the label bold and teh second normal you'd have to
plit them up into two (or more) labels as far as I can tell...
Hi Jesse
Actually I would like to know if I can do it in the same label,
without having two or more labels.
Cheers!
As far as I know it is not possible to use different fonts for
different parts of the same label, since it doesn't support anything
like RTF markups or the like.
So either you use two labels (one for the bold part, one for the
other) or you derive your own label class from label and handle the
drawing yourself.
I guess personally I would go with deriving in this case, since the
implementation would consist mostly of pretty basic GDI+ stuff and is
more flexible than always creating two labels.
hth,
Kevin Wienhold- Hide quoted text -
- Show quoted text -
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.