How to: Group Related Constant Values Together (Visual Basic)
An enumeration is the best way to group related constants together. You create an enumeration with the Enum
statement in the declarations section of a class or a module. For more information, see How to: Declare an Enumeration.
To group related constant values
Write a declaration that includes a code access level, the
Enum
keyword, and a valid name. This example creates thePrivate
enumeration,temperatureValues
.Private Enum temperatureValues
Define the constants in the enumeration. This example creates the
Public
enumerationtemperatureValues
and assigns its values.Public Enum temperatureValues Scorching Hot Lukewarm Cool Cold End Enum
See also
التعاون معنا على GitHub
يمكن العثور على مصدر هذا المحتوى على GitHub حيث يمكنك أيضاً إضافة مشاكل وطلبات سحب ومراجعتها. للحصول على معلومات إضافية، اطلع على دليل المساهم لدينا.
الملاحظات
https://aka.ms/ContentUserFeedback.
قريبًا: خلال عام 2024، سنتخلص تدريجيًا من GitHub Issues بوصفها آلية إرسال ملاحظات للمحتوى ونستبدلها بنظام ملاحظات جديد. لمزيد من المعلومات، راجعإرسال الملاحظات وعرضها المتعلقة بـ