For loops and enumeration

  • Thread starter Thread starter fred
  • Start date Start date
F

fred

If I have an enumeration where the values are not necessarily consecutive
can I do some sort of For each loop for each defined value. For example:

Public Enum CarType
Sedan = 2
Utility = 5
Van = 8
End Enum

For Each myCarType as CarType in CarType.Values
Obviously, this for loop doesn't work but is there some equivalent.

Thanks
Fred
 
For Each myCarType as CarType in CarType.Values
Obviously, this for loop doesn't work but is there some equivalent.

For Each myCarType as CarType in Enum.GetValues(GetType(CarType))



Mattias
 
Back
Top