Example #1
0
        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);
        }