Enumerations Overview (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.
Tasks involving Enumerations
The following table lists common tasks involving enumerations.
To do this | See |
---|---|
Find a pre-defined enumeration | Constants and Enumerations |
Declare an enumeration | How to: Declare an Enumeration |
Fully qualify an enumeration's name | Enumerations and Name Qualification |
Refer to an enumeration member | How to: Refer to an Enumeration Member |
Iterate through an enumeration | How to: Iterate Through An Enumeration in Visual Basic |
Determine the string associated with an enumeration | How to: Determine the String Associated with an Enumeration Value |
Decide when to use an enumeration | When to Use an Enumeration |
See also
Cộng tác với chúng tôi trên GitHub
Bạn có thể tìm thấy nguồn cho nội dung này trên GitHub, nơi bạn cũng có thể tạo và xem lại các vấn đề và yêu cầu kéo. Để biết thêm thông tin, hãy xem hướng dẫn dành cho người đóng góp của chúng tôi.
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