How can I use several combinations of font styles in VB.NET?

If I want to install my font, I can use

new Font=("Times New Roman", 12, Drawing.FontStyle.Bold) 

Instead of bold, I can use Italic, Regular or Underline.

But I want to use Bold and Italic at the same time.

How can i do this?

+6
fonts
source share
1 answer

FontStyle enumeration is an enumeration of flags, so you can combine the values ​​(using the Or operator in VB.NET, | in C #):

 new Font("Times New Roman", 12, Drawing.FontStyle.Bold Or Drawing.FontStyle.Italic) 
+11
source share

All Articles