Michael,
| Any ideas how to do this?
Yes! You already answered your own question:
| this are actually ReadOnly Shared
| Properties of the Color structure
You need to define your Structure, then you need to define Readonly Shared
Properties or Fields on that structure. Generally I use Readonly Shared
Fields as they are "easier" to define then properties...
Something like:
Public Structure Widget
Private ReadOnly m_value As Integer
Private Sub New(ByVal value As Integer)
m_value = value
End Sub
Public Shared ReadOnly Value1 As New Widget(1)
Public Shared ReadOnly Value2 As New Widget(2)
Public Shared ReadOnly Value3 As New Widget(3)
Public Shared ReadOnly Value4 As New Widget(4)
Public Sub Method1()
Public Function Method2() As Something
...
End Structure
I defined the constructor Private as there are a "fixed set of values" on
the Widget class, namely Value1, Value2, Value3, and Value4.
--
Hope this helps
Jay [MVP - Outlook]
..NET Application Architect, Enthusiast, & Evangelist
T.S. Bradley -
http://www.tsbradley.net
"Michael Feld" <mf***@t-online.de> wrote in message
news:ed**************@tk2msftngp13.phx.gbl...
| Hello,
|
| does anyone know how to produce a data type which offers Enum-like
| IntelliSense in VS 2005?
| What I am trying to create is a type which is very similar to an enum,
i.e.
| has a fixed set of values, but provides some more methods. Unfortunately,
| you cannot derive from System.Enum to do this.
|
| I noticed that if you type "Dim C as System.Drawing.Color = ", the editor
| will display a list of colors, but this are actually ReadOnly Shared
| Properties of the Color structure. So there must be a way to map structure
| members to enum constants...
|
| Any ideas how to do this?
|
|
| Thanks in advance!
|
| Michael
|
|