我找了下有combox但是,Item只是一个object对象,有没有键/值对形式的下拉控件。

解决方案 »

  1.   

    combox就是,他的SelectItem中有Text和Value
      

  2.   

    combox
    有个dropdownstyle可以改变风格的
      

  3.   

    Combox怎么可能没有值和显示呢!你仔细看看吧。
      

  4.   

    我是点的 编辑项  按钮,然后只能添加 一项一项的,不能分值和value
      

  5.   

    drpDecode.Items.Add()
                    drpDecode.Items.Insert()
    这两个添加项函数 不都是Object的参数吗
      

  6.   


    自己写一个类就可以实现啦public class Test
    {
      public Test(){}
      public string Text
      {get;set;}
      public string Value
      {
       get;set;
      }   public override string ToString()
       {
         return this.Text;
       }
    }//添加
    Test t = new Test();
    t.Text = "aaa";
    t.Value = "111";
    drpDecode.Items.Add(t);//调用
    string text = ((Test)drpDecode.SelectedItem).ToString();
    string text1 = ((Test)drpDecode.SelectedItem).Text;
    string value =((Test)drpDecode.SelectedItem).Value;//手写 没测试过....
      

  7.   


    // 调用
    Test t = new Test();
    t.Text = "aaa";
    t.Value = "111";
    drpDecode.Items.Add(t);
    //这个不能少
    drpDecode.DisplayMember = "Text"; 
    drpDecode.ValueMember = "Value";
      

  8.   

    combox1.datasource=datatable;
    combox1.DisplayMember="name";
    combox1.ValueMember="id";
    大概是这个样子了