PC Review


Reply
Thread Tools Rate Thread

combining FontStyle

 
 
=?Utf-8?B?Um9nZXI=?=
Guest
Posts: n/a
 
      7th Dec 2006
I know this is probably an easy question. But in VB.Net when you instantiate
a fontstyle object, the parameter for fontstyle, if you wanted it to be Bold
and Italic, you would enter "FontStyle.Bold + FontStyle.Italics". But in C#,
it does not like that syntax. What is the proper syntax in C#?
 
Reply With Quote
 
 
 
 
Marc Gravell
Guest
Posts: n/a
 
      7th Dec 2006
FontStyle.Bold | FontStyle.Italics

| is the bitwise or operator, which is what is wanted when combining [Flags]
enums.

In fact *strictly* speaking in VB.Net you should be using "FontStyle.Bold Or
FontStyle.Italics", otherwise you risk getting screwy numbers if one enum
value automatically includes another.

Marc


 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Changing the FontStyle Dom Microsoft C# .NET 3 4th Dec 2007 07:34 AM
FontStyle class xiaomitao@gmail.com Microsoft C# .NET 1 30th Jan 2007 12:31 PM
FontStyle Question OutdoorGuy Microsoft C# .NET 2 10th May 2005 03:12 PM
FontStyle.. VJ Microsoft VB .NET 5 28th May 2004 11:48 PM
FontStyle Question Sammut Microsoft C# .NET 1 14th Mar 2004 08:32 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 09:36 PM.