Scrollbar - little help understanding

Hi. Need a little help understanding how to best use the scrollbar.

I created a container with a few items. The container height is 600.

On another screen, I added the container control and it’s nestled in a PagePanel, height 632. Also in the PagePanel is the scrollbar (linestep 25, pagestep 50, minimum 0, maximum 100)

In the ScrollBar1.ValueChanged, I have this below, which I found on someone’s demo on the forum to use as a guide. Think his value was like 32, but I played around and changed it to 85

panelsContainer1.Top = 85 - me.Value

Problem is, when I scroll all the way down and then back up, the top part of the container is cut off some. So my question is, what is the calculation that is needed for the scrollbar to be most effective? How do you determine what to use? Is it based on the size of the container? The PagePanel? Just wanting to get a better understanding as I will be wanting to use another combination elsewhere in the project and want to make sure it is set up correctly.

Thanks!
Ryan

the physical size of the scroll bar should be approx the physical size of the visible area.
the MAXIMUM value should be approx the size of the scrollable image - physical size of scroll area

but those are guidelines… depends on the specific situation

Thanks Dave. Tricky to wrap the head around. I’m going to play with it more tomorrow