Enum

S

shapper

Hello,

I have a class property of type enum. The enum name is TemplateType:

Private _Type As TemplateType
< _
Bindable(True), _
DefaultValue(""), _
Public Property Type() As TemplateType
Get
Return _Type
End Get
Set(ByVal value As TemplateType)
_Type = value
End Set
End Property

I need to run some code if a Type was defined. If Type wasn't defined
then I will not run this code.

How can I do this?

Should I add a Enum item named None and make it the default value?

Thanks,

Miguel
 
T

Teemu Keiski

Enum is basically a value type and it does not have null directly (unless
you play with nullable types). Making an enum with None value is clear and
straighforward approach.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

Property default value 1
Update and Insert problems in ListView 1
ListView ... Update and Insert 0
Can't get rid of this error. ListView. Please, need help. 4
Enum and the designer 0
Enum Problem 1
Enum 4
Enum 3

Members online

No members online now.

Forum statistics

Threads
473,955
Messages
2,570,117
Members
46,705
Latest member
v_darius

Latest Threads

Top