public override void OnMouseMove(MouseEventArgs e) { if (_callingControl.Handle != IntPtr.Zero) { // Convert from Control coordinates to screen coordinates Point mousePos = _callingControl.PointToScreen(new Point(e.X, e.Y)); // Find HotZone this position is inside HotZone hz = _hotZones.Contains(mousePos); if (hz != _currentHotZone) { if (_currentHotZone != null) _currentHotZone.RemoveIndicator(mousePos); _currentHotZone = hz; if (_currentHotZone != null) _currentHotZone.DrawIndicator(mousePos); } else { if (_currentHotZone != null) _currentHotZone.UpdateForMousePosition(mousePos, this); } } base.OnMouseMove(e); }
public override void QuitTrackingMode(MouseEventArgs e) { // Have we quit tracking mode? if (_tracking) { if (_callingControl.Handle != IntPtr.Zero) { // Remove any visible tracking indicator if (_currentHotZone != null) { _currentHotZone.RemoveIndicator(new Point(0, 0)); } } base.QuitTrackingMode(e); } }