views:

224

answers:

1

Hey guys,

I was working on my vb6 project, and I needed my scrollbar max to reach 40000. Though I can assume that the max was around 32000 since the scrollbar max is an integer. How can I change this?

Thanks,

Kevin

+3  A: 

Why do you need to do that? Consider setting the range from 0 to 100, or 0 to 1000 (percentage of your document's size, basically), and scaling from that to the range that you need.

EDIT: For example, if you have a document with 40,000 lines, set the scrollbar maximum to 100. When you read the value, multiply it by the ratio of the document size over the maximum size of the scrollbar. When the scrollbar thumb is in the middle at 50, you'll get 50 * (40,000 / 100), or 20,000.

You'll have to use a long in VB6.

Michael Petrotta
What do you mean?
Kevin
He means that you can configure the min and max of the scroll bar to a value held in an integer, then change how THAT value changes during scrolling.
ShaunLMason
Exactly. Something like `position = scrollbarPosition * (docSize / scrollbarmax)`
Michael Petrotta