Attributes for Enumerations - Friendly Name

  • Thread starter Thread starter Mythran
  • Start date Start date
M

Mythran

I have an enum such as the following:

Public Enum MyEnum
EnumValue1
EnumValue2
EnumValue3
End Enum

I have bound, at run-time, the enumeration to a combo box. The combo box now has
three values, EnumValue1, EnumValue2, EnumValue3.

What I want is to display a friendly name for each enum value, such as:
"Enum Value 1", "Enum Value 2", and "Enum Value 3". Are there any attributes
that I can use? Such as something like Description that I can bind?

I need it this way so if I change the enumeration declaration, all combo boxes
that have the enumeration values bound would update at the same time.

Thanks,
Mythran
 
* "Mythran said:
Public Enum MyEnum
EnumValue1
EnumValue2
EnumValue3
End Enum

I have bound, at run-time, the enumeration to a combo box. The combo box now has
three values, EnumValue1, EnumValue2, EnumValue3.

What I want is to display a friendly name for each enum value, such as:
"Enum Value 1", "Enum Value 2", and "Enum Value 3". Are there any attributes
that I can use? Such as something like Description that I can bind?

I don't know if it will work with binding, but you can add a description
attribute:

<http://www.google.de/groups?selm=#[email protected]>
 
Back
Top