Dictionary<Int32, String> risk = new Dictionary<int, string>();
private void test(){
risk.Add(1, "Low");
risk.Add(2, "Medium");
risk.Add(3, "High");
comboBox1.DataSource = new BindingSource(risk, null);
comboBox1.DisplayMember = "Value";
comboBox1.ValueMember = "Key";
comboBox1.SelectedIndexChanged += new EventHandler(comboBox1_SelectedIndexChanged);
}
private void cmbName_SelectedIndexChanged(object sender, EventArgs e)
{
}
[출처]http://social.msdn.microsoft.com/Forums/en-US/winforms/thread/3695ced1-18ea-4b85-93c8-2ed04bf22dc5
'프로그래밍 > C#' 카테고리의 다른 글
| Combobox에 Key 와 Value 값을 설정해서 쓰자.. (0) | 2011/10/13 |
|---|---|
| 한동훈의 C# 쓰레드 이야기 (0) | 2011/10/07 |
| Invoke , BeginInvoke, MethodInvoker (0) | 2011/10/07 |
| MS Chart Control (0) | 2011/08/19 |
| [시간차구하기] 두 타임의 시간차 계산하기 (0) | 2011/08/15 |
| Array List 활용법(제너릭 클래스) (0) | 2011/07/04 |
