Windows Forms features a ScrollableControl. This will work in most cases where you know the exact dimensions of your control and scroll by pixel. See the MSDN Documentation for ScrollableControl for discussion how to use this control.
Sometimes you may need more customized scrolling, for example if you implemented a text editor and you want to scroll lines and not pixels.
For more customized scrolling you have to use PInvoke to acces the Win32 ScrollWindow method. The following code shows how to enable access to the Win32 ScrollWindow method from your code.
|