473,326 Members | 2,095 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,326 software developers and data experts.

Attributes for Enumerations - Friendly Name

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
Nov 20 '05 #1
1 1246
* "Mythran" <ki********@hotmail.com> 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/>
Nov 20 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Joyce | last post by:
In my schema I have 2 enumerations, let's say, country description and country code, and I want to use them so I can map each country description to its precise country code (and no other). So far...
1
by: Oleg Ogurok | last post by:
Hi all, I've added a new DataSet (xsd file) to my project in VS.NET 2003. There I create a simple type as an enumeration of values. <xs:simpleType name="MyCustomType"> <xs:restriction...
4
by: Turbot | last post by:
Hello, I have an ENUM that looks like this: Public Enum Locations As Byte Top_Left Top_Middle Top_Right Middle_Left Middle_Middle
77
by: Ben Finney | last post by:
Howdy all, PEP 354: Enumerations in Python has been accepted as a draft PEP. The current version can be viewed online: <URL:http://www.python.org/peps/pep-0354.html> Here is the...
16
by: Shawnk | last post by:
I would like to perform various boolean operations on bitmapped (FlagsAttribute) enum types for a state machine design as in; ------------------- enum portState { Unknown, Open,
1
by: cpisz | last post by:
How can I read and write an enum value to a file? The code in question: Cell temp; temp.m_x = x; temp.m_y = y; file >> temp.m_type; The error:
15
by: Jeff Mason | last post by:
Hi, I'm having a reflection brain fog here, perhaps someone can set me on the right track. I'd like to define a custom attribute to be used in a class hierarchy. What I want to do is to...
9
by: Brett Romero | last post by:
I'd like to create a class with public properties and functions that I can map into a datatable with corresponding fields. For example: ClassA string Name {get;set;} int Age{get;set;} boolean...
2
by: Dan Bron | last post by:
Hello, Does xsd.exe support generating .NET enumerations from XSD enumerations? That is, if I have ... <xs:simpleType name="US_STATE">
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.