Click here to Skip to main content
15,892,674 members
Articles / Programming Languages / C#

Using human readable enum values in a ComboBox

Rate me:
Please Sign up or sign in to vote.
4.00/5 (1 vote)
7 Feb 2012CPOL 8.9K   1  
Re-coded using LINQ. Stores the actual enum values in the combobox.public static void SetEnumValues(ComboBox cb){ Type t = typeof(T); if (!t.IsEnum) throw new ArgumentException("Only Enum types can be set"); cb.DisplayMember = "Key"; cb.ValueMember =...

Views

Daily Counts

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Retired
United Kingdom United Kingdom
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions