implicit conversions on FontStyles

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
 
J

Jay B. Harlow [MVP - Outlook]

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
 
H

Herfried K. Wagner [MVP]

* "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
///
 
B

Brian Henry

I tried Or before but forgot about the currstyle =... sorry its a brain dead
friday :)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top