ckanoab
asked on
Default values for a property in a class VB 2005
VB 2005 Express: Is there a way to define default values for a property? Simple example, when you type = after a boolean property, say... visible, it pops up intellisense true and false, is there a way to make custom options in place of true or false?
ASKER
And the values of those types? True translates to -1 and such, is that limited to numbers? Can it be a string?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
After the equals you would get the list of wet, dry and dirty:
Dim d As New Dog
d.MyDogsNose =
Here is the class:
Private Class Dog
Public Enum NoseType
wet
dry
dirty
End Enum
Private dogNoseType As Dog.NoseType
Public Property MyDogsNose() As Dog.NoseType
Get
Return dogNoseType
End Get
Set(ByVal value As Dog.NoseType)
dogNoseType = value
End Set
End Property
End Class