I need to get values of my enum, so I am using following command:
Array a = Enum.GetValues(typeof(Typ));
However, typical expression
a[x]
does not work, why?
Thanks
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Based on OPs comments, he might not actually be interested in the values of the
Enum, but instead of the names. The distinction can easily be confusing to beginners. Tip: When you ask questions involving an error (i.e. “does not work, why?”), then including the error message often helps.If you are looking for the names in the
Enum, try: