Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I set the Bold typeface for System.Windows.Fontstyle?

Tags:

c#

.net

There are only Italic, Normal, Oblique. But I need to set my FontStyle Bold.

like image 609
Juriy Avatar asked Nov 19 '12 07:11

Juriy


2 Answers

Bold isn't a FontStyle. It is a font weight. See this and this links.

For example:

control.FontWeight = FontWeights.Bold;

Update: Of course this answer is for XAML based frameworks (WPF, Silverlight, WinPhone, WinRT). In other frameworks bold can be style or something else.

like image 184
oryol Avatar answered Sep 26 '22 01:09

oryol


myTextBox.Font =
  new Font(myTextBox.Font, outputTextBox.Font.Style | FontStyle.Bold);
like image 23
CloudyMarble Avatar answered Sep 26 '22 01:09

CloudyMarble