// // Horizontal Scrollbar scroll event // private void hScrollBar_Scroll(object sender, ScrollEventArgs e) { offsetPoint.X = e.NewValue; Invalidate(); HorizontalScroll?.Invoke(this, e); }
// // Mouse Move event handler. Used to drag the viewport // protected override void OnMouseMove(MouseEventArgs e) { base.OnMouseMove(e); if (draggingViewport) { offsetPoint = new Point(-MousePosition.X + mouseOffset.X, -MousePosition.Y + mouseOffset.Y); // Fire scroll events HorizontalScroll?.Invoke(this, new ScrollEventArgs(ScrollEventType.ThumbPosition, offsetPoint.X)); VerticalScroll?.Invoke(this, new ScrollEventArgs(ScrollEventType.ThumbPosition, offsetPoint.Y)); ClipTransform(); Invalidate(); } }