コード例 #1
0
 protected override void OnMouseUp(MouseEventArgs e)
 {
     base.OnMouseUp(e);
     if (e.Button == MouseButtons.Left)
     {
         this._ControlStatus = AuroraControlStatus.Hover;
         this.Invalidate();
     }
 }
コード例 #2
0
 protected override void OnKeyDown(KeyEventArgs e)
 {
     base.OnKeyDown(e);
     if (e.KeyCode == Keys.Space)
     {
         this._ControlStatus = AuroraControlStatus.Pressed;
         this.Invalidate();
     }
 }
コード例 #3
0
 protected override void OnMouseDown(MouseEventArgs e)
 {
     if (e.Button == MouseButtons.Left)
     {
         this._ControlStatus = AuroraControlStatus.Pressed;
         this.Invalidate();
     }
     base.OnMouseDown(e);
 }
コード例 #4
0
 protected override void OnKeyUp(KeyEventArgs e)
 {
     base.OnKeyUp(e);
     if (e.KeyCode == Keys.Space)
     {
         this._ControlStatus = AuroraControlStatus.Default;
         this.Invalidate();
         this.OnClick(e);
     }
 }
コード例 #5
0
        /// <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();
        }
コード例 #6
0
 protected override void OnLostFocus(EventArgs e)
 {
     base.OnLostFocus(e);
     this._ControlStatus = AuroraControlStatus.Default;
     this.Invalidate();
 }
コード例 #7
0
 protected override void OnGotFocus(EventArgs e)
 {
     base.OnGotFocus(e);
     this._ControlStatus = AuroraControlStatus.Hover;
     this.Invalidate();
 }
コード例 #8
0
 protected override void OnMouseLeave(EventArgs e)
 {
     base.OnMouseLeave(e);
     this._ControlStatus = AuroraControlStatus.Default;
     this.Invalidate();
 }
コード例 #9
0
 protected override void OnMouseEnter(EventArgs e)
 {
     base.OnMouseEnter(e);
     this._ControlStatus = AuroraControlStatus.Hover;
     this.Invalidate();
 }
コード例 #10
0
 protected override void OnMouseUp(MouseEventArgs e)
 {
     this._ControlStatus = AuroraControlStatus.Default;
     this.Invalidate();
     base.OnMouseUp(e);
 }