/ Published in: C#
URL: http://madprops.org/blog/Bind-a-ComboBox-to-a-generic-Dictionary/
Expand |
Embed | Plain Text
choices["A"] = "Arthur"; choices["F"] = "Ford"; choices["T"] = "Trillian"; choices["Z"] = "Zaphod"; comboBox1.DisplayMember = "Value"; comboBox1.ValueMember = "Key"; //Now you can set comboBox1.SelectedValue = "F" and it will display "Ford"! How cool is that?
You need to login to post a comment.
