Enumerations Overview (Visual Basic)

 

Updated: July 20, 2015

Enumerations provide a convenient way to work with sets of related constants and to associate constant values with names. For example, you can declare an enumeration for a set of integer constants associated with the days of the week, and then use the names of the days rather than their integer values in your code.

The following table lists common tasks involving enumerations.

To do thisSee
Find a pre-defined enumerationConstants and Enumerations
Declare an enumerationHow to: Declare an Enumeration
Fully qualify an enumeration's nameEnumerations and Name Qualification
Refer to an enumeration memberHow to: Refer to an Enumeration Member
Iterate through an enumerationHow to: Iterate Through An Enumeration in Visual Basic
Determine the string associated with an enumerationHow to: Determine the String Associated with an Enumeration Value
Decide when to use an enumerationWhen to Use an Enumeration

Constants Overview
User-Defined Constants
How to: Declare A Constant
Constant and Literal Data Types
Enum Statement

Show: