//highlight pressed protected override void OnMouseDown(MouseEventArgs e) { base.OnMouseDown(e); loc = GetLocation(e.Location); if (loc != MouseLoc.Out) { this.Invalidate(); } }
//unhighlight, do clicking protected override void OnMouseUp(MouseEventArgs e) { base.OnMouseUp(e); //update and click ZoomTracker trk = this.Control as ZoomTracker; switch (loc) { case MouseLoc.ZoomIn: trk.Value++; break; case MouseLoc.ZoomOut: trk.Value--; break; default: return; } loc = MouseLoc.Out; tracker_ValueChanged(trk, new ValueChangedEventArgs()); }
//highlight pressed protected override void OnMouseDown(MouseEventArgs e) { base.OnMouseDown(e); loc = GetLocation(e.Location); if (loc != MouseLoc.Out) this.Invalidate(); }