Attributes for Enumerations - Friendly Name

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
 
H

Herfried K. Wagner [MVP]

* "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]>
 

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

Top