티스토리 툴바

달력

052012  이전 다음

  •  
  •  
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30
  • 31
  •  
  •  


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

Posted by 불펭