public RibbonCommandButton() { base.SetStyle(ControlStyles.UserPaint | ControlStyles.ResizeRedraw | ControlStyles.SupportsTransparentBackColor | ControlStyles.DoubleBuffer, true); base.SetStyle(ControlStyles.Opaque, false); base.FlatAppearance.BorderSize = 0; base.FlatStyle = FlatStyle.Flat; this.BackColor = Color.Transparent; base.TextImageRelation = TextImageRelation.ImageAboveText; this.Text = ""; base.Size = new Size(25, 25); this._command = RibbonCommandButton.mycommands.Maximize; this._state = RibbonCommandButton.mystates.Out; this._state = RibbonCommandButton.mystates.Out; }
protected override void OnMouseUp(MouseEventArgs mevent) { this._state = RibbonCommandButton.mystates.On; base.OnMouseUp(mevent); }
protected override void OnMouseLeave(EventArgs e) { this._state = RibbonCommandButton.mystates.Out; base.OnMouseLeave(e); }
protected override void OnMouseEnter(EventArgs e) { this._state = RibbonCommandButton.mystates.On; this.Cursor = Cursors.Arrow; base.OnMouseEnter(e); }