For instance say we have a scrollbar for showing/manipulating data on some application. Scrollbar has min, max values and visible amount as well. But there is a bit confusing thing about the range of the values to be shown according scrollbar value.
As an example here is an image

and

But it is calculated according different sides of the thumb of the scrollbar.
Say I need to show some data from database, and min value will be min id and max value will be max id as well. and consider I want to show 100 items, and I am going to set visible amount to 100 in scrollbar. While scrolling If the value of scroolbar is equal to 1, and getting the range from the database will be as simple as just adding 100 (visible amount) to 1, but this won't work when the value is equal to max. So that is why I need to get value range of the scrollbar thumb, but when looking at scrollbar source code I could not find the implementation of this feature.
How to get min and max values of the thumb or visible value range of the scrollbar?
