implicit conversions on FontStyles

  • Thread starter Thread starter Brian Henry
  • Start date Start date
B

Brian Henry

Hi, I am trying to build a font style like this

Dim currStyle As Drawing.FontStyle

currStyle = Drawing.FontStyle.Regular

currStyle += Drawing.FontStyle.Bold



but of course thats an implicit conversrion from integer to
system.drawing.fontstyle, how would you correct this problem? thanks
 
Brian,
You would use the Or operator to combine enum values, have you tried
something like:
Dim currStyle As Drawing.FontStyle

currStyle = Drawing.FontStyle.Regular

currStyle = currStyle Or Drawing.FontStyle.Bold

Hope this helps
Jay
 
* "Brian Henry said:
Hi, I am trying to build a font style like this

Dim currStyle As Drawing.FontStyle

currStyle = Drawing.FontStyle.Regular

currStyle += Drawing.FontStyle.Bold

\\\
currStyle = currSTyle Or FontStyle.Bold
///
 
Back
Top