protected override void OnMouseMove(System.Windows.Forms.MouseEventArgs e) { base.OnMouseMove(e); foreach (AbstractMargin margin in leftMargins) { if (margin.DrawingRectangle.Contains(e.X, e.Y)) { this.Cursor = margin.Cursor; margin.OnMouseMove(new Point(e.X, e.Y), e.Button); if (lastMouseInMargin != margin) { if (lastMouseInMargin != null) { lastMouseInMargin.OnMouseLeave(EventArgs.Empty); } lastMouseInMargin = margin; } return; } } if (lastMouseInMargin != null) { lastMouseInMargin.OnMouseLeave(EventArgs.Empty); lastMouseInMargin = null; } if (textViewMargin.DrawingRectangle.Contains(e.X, e.Y)) { this.Cursor = textViewMargin.Cursor; return; } this.Cursor = Cursors.Default; }
public void Refresh(AbstractMargin margin) { updateMargin = margin; Invalidate(updateMargin.DrawingRectangle); Update(); updateMargin = null; }
protected override void OnMouseLeave(System.EventArgs e) { base.OnMouseLeave(e); this.Cursor = Cursors.Default; if (lastMouseInMargin != null) { lastMouseInMargin.OnMouseLeave(EventArgs.Empty); lastMouseInMargin = null; } }