PC Review


Reply
Thread Tools Rate Thread

Attributes for Enumerations - Friendly Name

 
 
Mythran
Guest
Posts: n/a
 
      1st Mar 2004
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


 
Reply With Quote
 
 
 
 
Herfried K. Wagner [MVP]
Guest
Posts: n/a
 
      1st Mar 2004
* "Mythran" <(E-Mail Removed)> scripsit:
> 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=%23GSH4YOADHA.33376%40TK2MSFTNGP10.phx.gbl>

--
Herfried K. Wagner [MVP]
<http://dotnet.mvps.org/>
 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Data value display attributes linked to table attributes MDT at Paragon Home Inspections, LLC Microsoft Excel Charting 0 15th Nov 2006 12:53 AM
Upgrade W2K -> W2K3, Mangled Attributes, Can't find attributes =?Utf-8?B?Tmljay1NYXJz?= Microsoft Windows 2000 Active Directory 0 10th Feb 2005 10:43 PM
Friendly member names for Enumerations Turbot Microsoft VB .NET 4 11th Jan 2005 06:15 PM
Setting some file attributes doesn't work with FileInfo.Attributes =?Utf-8?B?Sm9obiBSLg==?= Microsoft C# .NET 7 18th Nov 2004 09:17 AM
enumerations C# beginner Microsoft C# .NET 4 24th Jan 2004 11:29 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 10:38 PM.