0

I was sure that if I perform the AND operator on:

FontStyle fontStyle;
fontStyle = FontStyle.Bold & FontStyle.Italic

The resulting FontStyle will be Bold Italic, but to my surprise the resulting FontStyle was: FontStyle.Regular. Please explain the way to programmatically set the FontStyle to Bold Italic. I use the FontFamily: New Times Roman. Thank you.

ProgrammingLlama
  • 36,677
  • 7
  • 67
  • 86
user2102327
  • 59
  • 2
  • 6
  • 19

1 Answers1

3

Use the OR operator to apply both.

fontstyle = FontStyle.Bold | FontStyle.Italic
HEWhoDoesn'tKnow
  • 347
  • 3
  • 14