protected override void OnMouseUp(MouseEventArgs e) { base.OnMouseUp(e); if (e.Button == MouseButtons.Left) { this._ControlStatus = AuroraControlStatus.Hover; this.Invalidate(); } }
protected override void OnKeyDown(KeyEventArgs e) { base.OnKeyDown(e); if (e.KeyCode == Keys.Space) { this._ControlStatus = AuroraControlStatus.Pressed; this.Invalidate(); } }
protected override void OnMouseDown(MouseEventArgs e) { if (e.Button == MouseButtons.Left) { this._ControlStatus = AuroraControlStatus.Pressed; this.Invalidate(); } base.OnMouseDown(e); }
protected override void OnKeyUp(KeyEventArgs e) { base.OnKeyUp(e); if (e.KeyCode == Keys.Space) { this._ControlStatus = AuroraControlStatus.Default; this.Invalidate(); this.OnClick(e); } }
/// <summary> /// 初始化<see cref ="AuroraButton" />类的新实例。 /// </summary> public AuroraButton() { this.SetStyle(ControlStyles.UserPaint, true); this.SetStyle(ControlStyles.AllPaintingInWmPaint, true); this.SetStyle(ControlStyles.OptimizedDoubleBuffer, true); this.SetStyle(ControlStyles.DoubleBuffer, true); this.SetStyle(ControlStyles.ResizeRedraw, true); this.SetStyle(ControlStyles.SupportsTransparentBackColor, true); this._ControlStatus = AuroraControlStatus.Default; this.Cursor = Cursors.Hand; base.TextImageRelation = TextImageRelation.ImageBeforeText; this.Size = new Size(100, 28); this.ResetRegion(); }
protected override void OnLostFocus(EventArgs e) { base.OnLostFocus(e); this._ControlStatus = AuroraControlStatus.Default; this.Invalidate(); }
protected override void OnGotFocus(EventArgs e) { base.OnGotFocus(e); this._ControlStatus = AuroraControlStatus.Hover; this.Invalidate(); }
protected override void OnMouseLeave(EventArgs e) { base.OnMouseLeave(e); this._ControlStatus = AuroraControlStatus.Default; this.Invalidate(); }
protected override void OnMouseEnter(EventArgs e) { base.OnMouseEnter(e); this._ControlStatus = AuroraControlStatus.Hover; this.Invalidate(); }
protected override void OnMouseUp(MouseEventArgs e) { this._ControlStatus = AuroraControlStatus.Default; this.Invalidate(); base.OnMouseUp(e); }