Page 1 of 1

WinForms: Scroll WinForms viewer programmatically.

Posted: Thu May 18, 2023 8:29 am
by Alex
This topic contains C# code snippet that allows to scroll WinForms viewer programmatically:

Code: Select all

// get current scroll position of image viewer
System.Drawing.PointF scrollPosition = imageViewer1.AutoScrollPositionEx;
// change current scroll position of image viewer
imageViewer1.AutoScrollPositionEx = new System.Drawing.PointF(scrollPosition.X, scrollPosition.Y + 50);