Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Export (0) Print
Expand All
Important This document may not represent best practices for current development, links to downloads and other resources may no longer be valid. Current recommended version can be found here.

How to: Refer to an Enumeration Member

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.

You can avoid using fully qualified names with the Imports statement. For more information, see Enumerations and Name Qualification.

To refer to an enumeration member

  • Qualify the member name with the enumeration. For example, the following example assigns the Saturday member of the FirstDayOfWeek enumeration to the variable DayValue.

    DayValue = FirstDayOfWeek.Saturday

Community Additions

© 2015 Microsoft