private void EndButtonPress() { this.pushed = UpDownBase.ButtonID.None; this.captured = UpDownBase.ButtonID.None; this.StopTimer(); base.CaptureInternal = false; base.Invalidate(); }
private void BeginButtonPress(MouseEventArgs e) { int num = base.Size.Height / 2; if (e.Y < num) { this.pushed = this.captured = UpDownBase.ButtonID.Up; base.Invalidate(); } else { this.pushed = this.captured = UpDownBase.ButtonID.Down; base.Invalidate(); } base.CaptureInternal = true; this.OnUpDown(new UpDownEventArgs((int)this.pushed)); this.StartTimer(); }
protected override void OnMouseMove(MouseEventArgs e) { if (base.Capture) { Rectangle rectangle = base.ClientRectangle; rectangle.Height /= 2; if (this.captured == UpDownBase.ButtonID.Down) { rectangle.Y += rectangle.Height; } if (rectangle.Contains(e.X, e.Y)) { if (this.pushed != this.captured) { this.StartTimer(); this.pushed = this.captured; base.Invalidate(); } } else if (this.pushed != UpDownBase.ButtonID.None) { this.StopTimer(); this.pushed = UpDownBase.ButtonID.None; base.Invalidate(); } } Rectangle clientRectangle = base.ClientRectangle; Rectangle rectangle3 = base.ClientRectangle; clientRectangle.Height /= 2; rectangle3.Y += rectangle3.Height / 2; if (clientRectangle.Contains(e.X, e.Y)) { this.mouseOver = UpDownBase.ButtonID.Up; base.Invalidate(); } else if (rectangle3.Contains(e.X, e.Y)) { this.mouseOver = UpDownBase.ButtonID.Down; base.Invalidate(); } this.parent.OnMouseMove(this.parent.TranslateMouseEvent(this, e)); }
protected override void OnMouseLeave(EventArgs e) { this.mouseOver = UpDownBase.ButtonID.None; base.Invalidate(); this.parent.OnMouseLeave(e); }
private void BeginButtonPress(MouseEventArgs e) { int num = base.Size.Height / 2; if (e.Y < num) { this.pushed = this.captured = UpDownBase.ButtonID.Up; base.Invalidate(); } else { this.pushed = this.captured = UpDownBase.ButtonID.Down; base.Invalidate(); } base.CaptureInternal = true; this.OnUpDown(new UpDownEventArgs((int) this.pushed)); this.StartTimer(); }