ArrayList 需要引用命名空间 using System.Collections;
1、赋值,在form_load是添加
ArrayList mylist = new ArrayList();
mylist.Add(new DictionaryEntry("1", "全部"));
mylist.Add(new DictionaryEntry("2", "正常"));
mylist.Add(new DictionaryEntry("3", "终止"));
comboBox1.DataSource = mylist;
comboBox1.DisplayMember = "Value";
comboBox1.ValueMember = "Key";
2、获取
获取选中的键值:comboBox1.SelectedValue;
获取选中的键名:comboBox1.Text;
3、初始化,比如初始化是第一选项
comboBox1.SelectedValue = “1”;