public Form1() { InitializeComponent(); CustomButtonStyle style2 = new CustomButtonStyle(customButton2.Width, customButton2.Height,ButtonBorder.RoundRectangle); customButton2.Style = style2; }
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); }
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); }
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); }
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; }