hehe将值填到combobox中,combobox不要设成dropdownlist就可以了啊

解决方案 »

  1.   

    晕,我的意思是说在自定义控件里面;难道自定义控件中有combobox这样的属性吗?
      

  2.   

    Eg:        [
            Category("Behavior"),
            DefaultValue(MyType.a),
            Description("This is a test")
            ]
      

  3.   

    public  enum MyType
    {
    a,
    b,
    c,
    d
    }
      

  4.   

    老兄:这样不行啊.这样只是跟原来一样;没什么变化.我是想在自定义控件中实现一个像comobbox一个的属性;既是可以选择也可以填写.
      

  5.   

    private MyType t;                   [
                          Category("Behavior"),
                          DefaultValue(MyType.a),
                          Description("This is a test")
                       ]
    public MyType MyTest
    {
    get{return t;}
    set{t = value;}
    } public  enum MyType
    {
    a,
    b,
    c,
    d
    }这是服务器控件
      

  6.   


    你用 enum 就是错误的设计。
      

  7.   

    上面的实例我测试通过
    不过我的MyTest是虚方法 
    vitual
      

  8.   

    我的还是不行;// [
    // Category("Behavior"),
    // DefaultValue(MyType.a),
    // Description("This is a test")
    // ]
    public virtual MyType MyTest
    {
    get{return t;}
    set{t = value;}
    } public enum MyType
    {
    a,
    b,
    c,
    d
    }
    你的是这样吗?
    还请各位过来看看是什么问题.