none
自定义控件里添加复杂属性 RRS feed

  • 问题

  • 需要使用4个颜色值 组合成 argb 颜色

    但是不知道为什么 不能输入?

    	[TypeConverter(typeof(ExpandableObjectConverter))]
            public class Hovercolor
            {
                private int mnalpha=0, mnred=0, mnblue=0, mngreen=0;
    
            public int hoveralpha
            {
                get { return mnalpha; }
                set {
                    mnalpha = value; 
                }
            }
    
    
            public int hoverred
            {
                get { return mnred; }
                set
                {
                     mnred = value; 
                }
            }
    
            public int hovergreen
            {
                get { return mngreen; }
                set
                {
                     mngreen = value; 
                }
            }
    
            public int hoverblue
            {
                get { return mnblue; }
                set
                {
                    mnblue = value; 
                }
            }
    
            public override string ToString()
            {
                return mnalpha + "," + mnred + "," + mnblue + "," + mngreen;
            }
        }
            private Hovercolor score;
    
            public Hovercolor MiniFromArgb
            {
                get { return score; }
                set { score = value; }
            }
    

    2016年7月5日 12:31

答案

全部回复