Declare Enum variable : Enum « Data Type « VB.Net Tutorial





Public Enum AccessLevel
    Clerk
    Supervisor
    Administrator
End Enum


public class Test
   public Shared Sub Main

    Dim m_AccessLevel As AccessLevel
    m_AccessLevel = AccessLevel.Supervisor
    
   End Sub
End class










2.20.Enum
2.20.1.Define Enum and assign value
2.20.2.Define and use Enum as Integer
2.20.3.Declare Enum variable
2.20.4.Public Enum type
2.20.5.Assign value to Enum elements
2.20.6.Assign value to only one Enum element
2.20.7.Cast Integer to Enum value
2.20.8.Convert Enum to Integer
2.20.9.Enum value duplication
2.20.10.Compare Enum element using logic operator
2.20.11.Converting an enumerated value to a string.
2.20.12.Standard Enumeration Format Specifiers