Retrieves an array of the names of the constants in a specified enumeration.
- enumType (Type)
- An enumeration type.
A string array of the names of the constants in enumType.
The elements of the array are sorted by the values of the enumerated constants.
| Platforms Supported | |
|---|---|
| Windows Mobile | Windows Mobile Version 5.0 and later |
| Windows Phone | Windows Phone 7 |
| Windows Embedded Compact | Windows CE .NET 4.1 and later |
The follow example shows how to enumerate the members of the DayOfWeek enumeration by adding them to a ComboBox:-
CopyVB.NET
CopyC#
Dim thisDOW As New DayOfWeek For Each thisDOW In InTheHand.EnumHelper.GetValues(Type.GetType("System.DayOfWeek")) ComboBox1.Items.Add(thisDOW) Next
foreach(DayOfWeek thisdow in InTheHand.EnumHelper.GetValues(typeof(DayOfWeek))) { comboBox1.Items.Add(thisdow); }
| Exception | Condition |
|---|---|
| ArgumentException | enumType parameter is not an System.Enum |