Beispiel #1
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);
        }
Beispiel #2
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);
        }