Making an IEnumerable Enum - .Net Framework

The following C# code demonstrates how to enumerate through all possible values of an Enum type within a foreach loop. Replace EnumType with your enum type. You can convert code between C# and VB.NET at this website.

EnumType[] values = (EnumType[])Enum.GetValues(typeof(EnumType));

foreach (EnumType value in values)
{
    ...
}