Gets or sets the upper limit of values of the scrollable range.
Assembly: System.Windows.Forms (in System.Windows.Forms.dll)
You might consider adjusting the property dynamically to match the size of the scroll bar's parent in proportion to pixel size or to the number of rows or lines displayed.
The maximum value can only be reached programmatically. The value of a scroll bar cannot reach its maximum value through user interaction at run time. The maximum value that can be reached through user interaction is equal to 1 plus the property value minus the LargeChange property value. If necessary, you can set the property to the size of the object -1 to account for the term of 1.
The following example assumes that you have created a Form, added a PictureBox to the Form, and added a horizontal HScrollBar and a vertical VScrollBar to the PictureBox. This code example is part of a larger example provided for the ScrollBar class overview.
For instructions about how to run this example in Visual Studio, see How to: Compile and Run a Complete Windows Forms Code Example Using Visual Studio.