Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

Tags:

vb.net

fonts

If I want to set 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 make use of Bold and Italic at the same time.

How can I do this?

like image 302
ssm Avatar asked Feb 02 '10 19:02

ssm


1 Answers

The FontStyle enumeration is a flags enumeration, so you can combine values (using the Or operator in VB.NET, | in c#):

new Font("Times New Roman", 12, Drawing.FontStyle.Bold Or Drawing.FontStyle.Italic)
like image 131
Fredrik Mörk Avatar answered Oct 04 '22 00:10

Fredrik Mörk