向ComboBox添加值 不指定

Else , 2010/03/10 16:52 , 代码片段,演示也有 , Comments(0) , Reads(1017) , Via Original
  ArrayList arList=new ArrayList();
            arList.Add(new DictionaryEntry("1", "單張立帳"));
            arList.Add(new DictionaryEntry("2", "不立帳"));
            arList.Add(new DictionaryEntry("3", "開出發票才立帳"));

            this.txt_lizhang.DisplayMember = "Value";
            this.txt_lizhang.ValueMember = "Key";

            this.txt_lizhang.DataSource = arList;
            txt_lizhang.SelectedValue = "3";
Add a comment

Nickname

Site URI

Email

Enable HTML Enable UBB Enable Emots Hidden Remember [Login] [Register]