How to: Refer to an Enumeration Member (Visual Basic)
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 theFirstDayOfWeek
enumeration to the variableDayValue
.DayValue = FirstDayOfWeek.Saturday
See also
Phản hồi
https://aka.ms/ContentUserFeedback.
Sắp ra mắt: Trong năm 2024, chúng tôi sẽ dần gỡ bỏ Sự cố với GitHub dưới dạng cơ chế phản hồi cho nội dung và thay thế bằng hệ thống phản hồi mới. Để biết thêm thông tin, hãy xem:Gửi và xem ý kiến phản hồi dành cho