Is this possible? I wish to use a For Loop or something the get all the entries in an enum...
Printable View
Is this possible? I wish to use a For Loop or something the get all the entries in an enum...
The Enum class has several static members, including GetNames and GetValues, e.g.:Code:foreach (string val in Enum.GetNames(typeof(DialogResult)))
{
MessageBox.Show(val);
}
Thanks again! :afrog: