Tag Archives: enumeration

Use the yield statement in C#

An enumeration is a sequence of values that a program can enumerate over, for example, by using a foreach loop. In C# you can use the yield statement to make a method that returns an enumeration. The method that builds … Continue reading

Posted in algorithms, mathematics | Tagged , , , , , , , , , , , , | Leave a comment

Initialize a ComboBox from an enumeration in C#

Often it’s useful to initialize a ComboBox from an enumeration so the user can pick one of the enumeration’s values. You could type the value into the ComboBox at design time, but then if the enumeration changes, you’ll have to … Continue reading

Posted in controls, user interface | Tagged , , , , , , , , , , , , | Leave a comment