AlexF777
asked on
Looking for an alternative to enumeration in C
something that would let me do this:
Enum Color ( red = 0, yellow = 1, green = 2 )
if Color = red then ...
if Color = yellow then ...
if Color = green then ...
Enum Color ( red = 0, yellow = 1, green = 2 )
if Color = red then ...
if Color = yellow then ...
if Color = green then ...
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
The advantage to using the 'ColorConstants' type is that you can freely apply it to other controls, it is the vb standard.
For example:
Dim myColor As ColorConstants
myColor = vbBlue
'// apply our color to the forecolor of a label
label1.forecolor = myColor
For example:
Dim myColor As ColorConstants
myColor = vbBlue
'// apply our color to the forecolor of a label
label1.forecolor = myColor
Although, these suggestions do not really answer your question, however i felt it might be a good idea to shed some light on this.
Dim myColor As ColorConstants
myColor = vbBlue
Select Case myColor
Case vbRed
MsgBox "You're Red"
Case vbBlue
MsgBox "Youre Blue"
Case Else
MsgBox "You're not red or blue :("
End Select