Tag Archives: enumerated type

Validate a switch statement that uses values from an enumerated type in C#

This example shows how you can validate a switch statement that uses values defined in an enumerated type. Enumerated types and switch statements often go hand-in-hand. You define an enumerated type and then later use a switch statement to see … Continue reading

Posted in debugging | 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