Public Enum Numbers
<Description("This is 10.")> Ten = 10
<Description("This is 11.")> Eleven = 11
End Enum
How do I get the descrition text via code?
Dim theString As String = ???
Thx.
Dim ten As FieldInfo = GetType(Numbers).GetField("Ten")
Dim attr As DescriptionAttribute =
DirectCast(ten.GetCustomAttributes(GetType(DescriptionAttribute),
False)(0), DescriptionAttribute)
theString = attr.Description
Mattias
--
Mattias Sjögren [MVP] mattias @ mvps.org
http://www.msjogren.net/dotnet/
Please reply only to the newsgroup.