Enum string

G

Guest

How can you get the string representation of an enum in the .NET Compact
Framework?

Enum Colors
Red
Green
Blue
Yellow
End Enum 'Colors

In the full framework you can simple do something like:
Colors.Red.ToString("g")
-Or-
[Enum].GetName(GetType(Colors), Colors.Red)
'Both return the string "Red"

But I cannot find a way to do that in the compact framework. Any ideas?

Thanks
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top