complete-reference-vb_net_12
complete-reference-vb_net_12
Enum
To work with the GridVectorsEnum enumeration in our code, reference it with the Imports statement or
directly in the class and declare the type as follows:
While enumerated types are familiar to many programmers of languages like Delphi and C++, they are much
more useful in the .NET Framework. They are typically processed in the stack area, but can also be boxed
onto the heap as objects.
Every Enum must have an underlying type that represents one of the ordinal built−in types: Byte, Integer,
Long, and Short. If you do not initialize the enumeration constants with values, they default to Integer. The
following example specifies constants of the default Integer type:
When you create and reference enumerated types, they are essentially compiled to constant fields. So the
following Enum called EnumDays,
Class MyDays
Public Const Sunday = 1
Public Const Monday = 2
Public Const Tuesday = 3
Public Const Wednesday = 4
Public Const Thursday = 5
Public Const Friday = 6
Public Const Saturday = 7
250