
Retrive Enum Value if I have Enum Constant Name as a String
I have the following ENUM:
Public Enum TemplateColor As Integer
BlueDark = &H91A7CA
BlueLight = &HDEE4EF
GreenDark = &H669966
GreenLight = &HE3ECE1
TaupeDark = &HD6D8B8
TaupeLight = &HF0F0E1
GreyDark = &H7C8A94
GreyLight = &HE9E9E9
PurpleDark = &HA0A0C0
PurpleLight = &HDEE4EF
End Enum
How can retrieve the Enum Value if I only have the name of the constant as
a string(e.g. GreyDark, BlueDark) .
I have tried the following to no avail:
Dim t As TemplateColor
Dim s As TemplateColor = t.Parse(GetType(TemplateColor),
strDarkColor)
Here, S only returns the value passed via strDarkColor.
L Anthony Johnson