how to loop an enum code example
Example 1: loop over enum values
var values = Enum.GetValues(typeof(EnumName));
foreach (var value in values)
{
Combobox.Items.Add(value.ToString());
}
Example 2: how to loop through a python enum
from enum import Enum
class Country(Enum):
Afghanistan = 93
Albania = 355
Algeria = 213
Andorra = 376
Angola = 244
Antarctica = 672
for data in Country:
print('{:15} = {}'.format(data.name, data.value))