This is a really nice little feature.
If we have an enumerator, say:
public enum MyEnumerator { Oranges, Apples, Hedgehogs, Laptops, Budgies, Other }
Having a form with a ComboBox called comboBox1, put this in the constructor/form load etc:
this.comboBox1.DataSource = Enum.GetValues(typeof(MyEnumerator));
This fills the combobox with the values. To convert the current combobox value back into the enumerator’s value:
MyEnumerator [...]
-
Home > ComboBox