473,403 Members | 2,323 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,403 software developers and data experts.

Enum.GetNames

a.. How can I return all the values in a enumerator. I tried like the
following, but it doesn't work and there are no examples in the VS Help:
enum test {a, b, c}
Console.WriteLine(Enum.GetNames(test));
thanks,

Nov 13 '05 #1
1 2843
Marcelo try something like this:

foreach(string t in Enum.GetNames (typeof(test)))

Console.WriteLine (t);

HTH,

Sasha Imamovich

"J. Marcelo Barbieri" <mb*******@bf.com.br> wrote in message
news:#r**************@TK2MSFTNGP12.phx.gbl...
a.. How can I return all the values in a enumerator. I tried like the
following, but it doesn't work and there are no examples in the VS Help:
enum test {a, b, c}
Console.WriteLine(Enum.GetNames(test));
thanks,

Nov 13 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: smith | last post by:
It's a time saver to "bind" .Net enums to list and comboboxes and all the samples out there seem to use GetNames and GetValues pretty interchangeably. So I was wondering what the logic is to the...
2
by: Mark | last post by:
Assume you've declared an enum .... public enum MyEnum { First, Second, Third } Without knowing the values of the enum, is it possible to iterate through all the possible values...
2
by: Armin Bajramovic | last post by:
Hi, I have enum: public enum StatusEnum { Active = 'A', Nonactive = 'N', Deleted = 'D' }
3
by: cyshao | last post by:
Hi ,my friends: I have a enum type ,EMyEnum , defigned as . I just want to do something like this: foreach( EMyEnum crrEnum in EMyEnum ) { //do something }
2
by: wapsiii | last post by:
I'm trying to do this http://geekswithblogs.net/jawad/archive/2005/06/24/EnumDropDown.aspx public enum Color { RED, GREEN, BLUE }
21
by: dllhell | last post by:
hi all, I have a problem with creating proc with a enum as a param. I wish to pass an enumeration in proc in which one I intend to do some operations with enumeration, but I don't know which one...
7
by: Harris | last post by:
Dear all, I have the following codes: ====== public enum Enum_Value { Value0 = 0, Value1 = 10,
34
by: Steven Nagy | last post by:
So I was needing some extra power from my enums and implemented the typesafe enum pattern. And it got me to thinking... why should I EVER use standard enums? There's now a nice little code...
3
by: shapper | last post by:
Hello, I have an enum: Public Enum Color Red Blue Green End Enum
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.