示例#1
0
        public Form1()
        {
            InitializeComponent();

            CustomButtonStyle style2 = new CustomButtonStyle(customButton2.Width, customButton2.Height,ButtonBorder.RoundRectangle);
            customButton2.Style = style2;
        }
示例#2
0
        public CustomButtonStyle Clone()
        {
            CustomButtonStyle style = new CustomButtonStyle(this._width, this._height, _border);

            style.FillBrushNormal  = _fillBrushNormal;
            style.BorderPenNormal  = _borderPenNormal;
            style.FillBrushHot     = _fillBrushHot;
            style.BorderPenHot     = _borderPenHot;
            style.FillBrushPressed = _fillBrushPressed;
            style.BorderPenPressed = _borderPenPressed;

            style.CornerRadius = _cornerRadius;
            style.Shape        = ConvertShape(_border);

            return(style);
        }
示例#3
0
        public CustomButton(int width, int height)
        {
            this.Width  = width;
            this.Height = height;

            base.SetStyle(ControlStyles.StandardDoubleClick | ControlStyles.StandardClick, false);
            this.SetStyle(
                ControlStyles.AllPaintingInWmPaint |
                ControlStyles.OptimizedDoubleBuffer |
                ControlStyles.ResizeRedraw |
                ControlStyles.UserPaint |
                ControlStyles.SupportsTransparentBackColor,
                true
                );

            this.BackColor = Color.Transparent;

            _onMove    = false;
            _onPress   = false;
            _lastPoint = new Point(-1, -1);

            _style = CustomButtonStyle.CreateDefaultStyle(width, height);
        }
示例#4
0
        public CustomButton(int width,int height)
        {
            this.Width = width;
            this.Height = height;

            base.SetStyle(ControlStyles.StandardDoubleClick | ControlStyles.StandardClick, false);
            this.SetStyle(
                ControlStyles.AllPaintingInWmPaint |
                ControlStyles.OptimizedDoubleBuffer |
                ControlStyles.ResizeRedraw |
                ControlStyles.UserPaint |
                ControlStyles.SupportsTransparentBackColor,
                true
            );

            this.BackColor = Color.Transparent;

            _onMove = false;
            _onPress = false;
            _lastPoint = new Point(-1, -1);

            _style = CustomButtonStyle.CreateDefaultStyle(width, height);
        }
示例#5
0
        public CustomButtonStyle Clone()
        {
            CustomButtonStyle style = new CustomButtonStyle(this._width, this._height, _border);

            style.FillBrushNormal = _fillBrushNormal;
            style.BorderPenNormal = _borderPenNormal;
            style.FillBrushHot = _fillBrushHot;
            style.BorderPenHot = _borderPenHot;
            style.FillBrushPressed = _fillBrushPressed;
            style.BorderPenPressed = _borderPenPressed;

            style.CornerRadius = _cornerRadius;
            style.Shape = ConvertShape(_border);

            return style;
        }