Enum string

  • Thread starter Thread starter Guest
  • Start date Start date
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
 
Back
Top