/// <summary> /// Called whent he cursor changes. /// </summary> /// <param name="e">The event args.</param> protected override void OnSetCursor(SetCursorEventArgs e) { _cachedLink = null; if (_pageCacheValid) { var offset = GetScrollOffset(); var location = new Point( e.Location.X - offset.Width, e.Location.Y - offset.Height ); for (int page = _visiblePageStart; page <= _visiblePageEnd; page++) { foreach (var link in GetPageLinks(page)) { if (link.Bounds.Contains(location)) { _cachedLink = link; e.Cursor = Cursors.Hand; return; } } } } base.OnSetCursor(e); }
protected override void OnSetCursor(SetCursorEventArgs e) { if (_canPan && e.HitTest == HitTest.Client) { e.Cursor = PanCursor; } base.OnSetCursor(e); }
protected virtual void OnSetCursor(SetCursorEventArgs e) { var handler = SetCursor; if (handler != null) { handler(this, e); } }
private void WmSetCursor(ref Message m) { var e = new SetCursorEventArgs( PointToClient(Cursor.Position), (HitTest)(m.LParam.ToInt32() & 0xffff) ); OnSetCursor(e); Cursor.Current = e.Cursor ?? Cursor; }