Answers for "iterate over values in enum"

C#
3

loop over all values in enum

var values = Enum.GetValues(typeof(Foos)).Cast<Foos>();
Posted by: Guest on April-14-2020
1

loop over enum values

var values = Enum.GetValues(typeof(EnumName));

foreach (var value in values)
{
	Combobox.Items.Add(value.ToString());
}
Posted by: Guest on May-21-2020

Code answers related to "iterate over values in enum"

C# Answers by Framework

Browse Popular Code Answers by Language