[WinForm] 사용자정의 콘트롤

2020. 3. 26. 11:41C#/WinForm

사용자 정의 콘트롤 만들고 속성값을 클래스로 만들기

[System.ComponentModel.TypeConverter(typeof(System.ComponentModel.ExpandableObjectConverter))]
    public class Gradiant_Color
    {
        public Color Top
        {
            get;set;
        }
        public Color Mid
        {
            get;set;
        }
        public Color Bottom
        {
            get; set;
        }
    }

 

위에 정의 해주면 된다. 

사용은 똑같이 

 public Gradiant_Color GradiantColor
        {
            get
            {
                return _color;
            }
            set
            {
                _color = value;
            }
        }