Using Enumerated Types

Types defined using the Enum keyword are implicitly derived from ValueType just as structures are. Enumerated types provide a convenient notation for defining a list of values semantically associated to a named value. As demonstrated earlier, for example, you could use an enumeration EyeColor to constrain valid values for eye colors to realistic colors. In contrast, if you used the Color type, you might end up with indications that someone has mauve or cyan-colored eyes.

Table 5.1 lists the shared members of System.Enum types and provides a brief description for each. You will see these capabilities used where it's appropriate to do so, throughout this book.

Table 5.1. System.Enum Members
Member Description
Format Converts ...

Get Visual Basic® .NET Unleashed now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.