Brian Hooper
Brian Hooper

Reputation: 22054

How to get a scroll bar to reach the maximum in VB.Net

I am using a Vertical Scroll Bar (VScrollBar) object and setting the minimum and maximum values...

MyScrollBar.Minimum = 0
MyScrollBar.Maximum = 243

but find that however many times I click the down-arrow, the value does not exceed 234. The scroll bar is so short that the actual slider bar is invisible and only the arrows are usable.

How do I set up the scroll-bar so the maximum value is attainable?

I could just add a bit to the maximum value but this seems like a bit of a hack and likely to present difficulties if the scrollbar changes length, which it will do in the fullness of time. I also looked through the properties and couldn't find any likely culprit, or at least not one with a value around 11.

Upvotes: 1

Views: 1509

Answers (1)

Shadi
Shadi

Reputation: 1771

Try setting Maximum to be:

Maximum = Max_you_want + LargeChange - 1

This works for me.

Upvotes: 2

Related Questions