Click here to Skip to main content
15,900,725 members
Home / Discussions / C#
   

C#

 
GeneralRe: Iterating through all values of an ORed enum variable... Pin
Shy Agam9-Jul-07 8:51
Shy Agam9-Jul-07 8:51 
GeneralRe: Iterating through all values of an ORed enum variable... Pin
Martin#9-Jul-07 9:06
Martin#9-Jul-07 9:06 
GeneralRe: Iterating through all values of an ORed enum variable... Pin
Luc Pattyn9-Jul-07 9:18
sitebuilderLuc Pattyn9-Jul-07 9:18 
GeneralRe: Iterating through all values of an ORed enum variable... Pin
Luc Pattyn9-Jul-07 9:27
sitebuilderLuc Pattyn9-Jul-07 9:27 
GeneralRe: Iterating through all values of an ORed enum variable... Pin
Martin#9-Jul-07 9:54
Martin#9-Jul-07 9:54 
AnswerRe: Iterating through all values of an ORed enum variable... Pin
PhilDanger9-Jul-07 7:17
PhilDanger9-Jul-07 7:17 
GeneralRe: Iterating through all values of an ORed enum variable... Pin
Shy Agam9-Jul-07 8:02
Shy Agam9-Jul-07 8:02 
AnswerRe: Iterating through all values of an ORed enum variable... Pin
PhilDanger9-Jul-07 10:55
PhilDanger9-Jul-07 10:55 
FYI, here's another way to do it w/ Enum.Parse method, which is undoubtably slower and takes more memory, but improves readability (maybe Big Grin | :-D )

[Flags]
enum Keys
{
    A = 1,
    B = 2,
    C = 4,
    D = 8
}

static void Main(string[] args)
{


    Keys keys = Keys.A | Keys.B | Keys.D;
    string[] strKeys = keys.ToString().Split(',');
    foreach(string key in strKeys){
        Keys newKey = (Keys)Enum.Parse(keys.GetType(),key);
        Console.WriteLine(newKey.ToString());
    }
}

QuestionHow to play at the same time 2 or more sounds Pin
mayhem709-Jul-07 4:58
mayhem709-Jul-07 4:58 
AnswerRe: How to play at the same time 2 or more sounds Pin
mav.northwind9-Jul-07 19:21
mav.northwind9-Jul-07 19:21 
AnswerRe: How to play at the same time 2 or more sounds Pin
Hesham Yassin9-Jul-07 22:38
Hesham Yassin9-Jul-07 22:38 
Questionhow to sort datagridview ? (a numeric field) Pin
cmpeng349-Jul-07 4:53
cmpeng349-Jul-07 4:53 
AnswerRe: how to sort datagridview ? (a numeric field) Pin
velkropie9-Jul-07 6:24
velkropie9-Jul-07 6:24 
AnswerRe: how to sort datagridview ? (a numeric field) Pin
Luc Pattyn9-Jul-07 7:12
sitebuilderLuc Pattyn9-Jul-07 7:12 
QuestionHow do I Marshal Vector using Pinvoke Pin
Subodh Borker9-Jul-07 4:41
Subodh Borker9-Jul-07 4:41 
QuestionCrystal Reports Gurus - need help - please Pin
Rome'9-Jul-07 4:27
Rome'9-Jul-07 4:27 
QuestionUdp client Programming Pin
ramdil9-Jul-07 3:57
ramdil9-Jul-07 3:57 
AnswerRe: Udp client Programming Pin
Jimmanuel9-Jul-07 4:18
Jimmanuel9-Jul-07 4:18 
GeneralRe: Udp client Programming Pin
ramdil9-Jul-07 4:41
ramdil9-Jul-07 4:41 
GeneralRe: Udp client Programming Pin
Jimmanuel9-Jul-07 4:52
Jimmanuel9-Jul-07 4:52 
GeneralRe: Udp client Programming Pin
Luc Pattyn9-Jul-07 5:05
sitebuilderLuc Pattyn9-Jul-07 5:05 
GeneralRe: Udp client Programming Pin
ramdil9-Jul-07 5:12
ramdil9-Jul-07 5:12 
GeneralRe: Udp client Programming Pin
Jimmanuel9-Jul-07 5:20
Jimmanuel9-Jul-07 5:20 
GeneralRe: Disconnecting your Ethernet may keep your app alive ! Pin
Luc Pattyn9-Jul-07 5:56
sitebuilderLuc Pattyn9-Jul-07 5:56 
GeneralRe: Disconnecting your Ethernet may keep your app alive ! Pin
Jimmanuel9-Jul-07 6:34
Jimmanuel9-Jul-07 6:34 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.