Aug 7, 2002 #1 KoRUPT Programmer Jul 25, 2002 25 CA How would I go about Iterating through all the elements of an enumeration in C#? Something like so: public enum Test{One, Two, Three, Four, Five}; foreach(Test t in Test) { MessageBox.Show(t.ToString()); } This doesnt work unfortunatly
How would I go about Iterating through all the elements of an enumeration in C#? Something like so: public enum Test{One, Two, Three, Four, Five}; foreach(Test t in Test) { MessageBox.Show(t.ToString()); } This doesnt work unfortunatly
Aug 7, 2002 #2 chiph Programmer Jun 9, 1999 9,878 US I think you can do it via reflection, but it won't be what you'd call fast. Or pretty. Chip H. Upvote 0 Downvote