Intuitively one would assume that the Minimum
and Maximum
properties of ScrollBar can be used to control its range accessible by the user, but Maximum
's MSDN article states:
You might consider adjusting the
Maximum
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
Maximum
property value minus theLargeChange
property value. If necessary, you can set theMaximum
property to the size of the object -1 to account for the term of 1.
Can you explain why this is so?
I'm guessing that this is because the value of the scroll bar refers to the start of the range displayed by the scrollable area. So if the user were allowed to scroll to its maximum value via user interaction, then they would be able to scroll the content off the top of the control.
Often times I've seen applications that do allow you to scroll until the end of the content passes the top of the scrolling region. (Leaving a blank region visible.) But intuitively you'd expect that the scroll bar would stop you once the you've reached the bottom of the scrollable region.
I know I just sound like a raving lunatic. Hopefully it made some sense.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With