• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 415
  • Last Modified:

Need to exceed vertical scroll bar max allowed height

I have a picture control within a picture control.  Next to the outside picture control I have a invisible vertical scroll bar.  On the inner picture control I have a control array.  The control array grows vertically, increasing the height of the inner picture control as needed.  When the height of the inner picture control exceeds the height of the outer picture control, the vertical scroll bar is made visible and is used to scroll the inner picture control.  

I use the height properties of the picture controls to set the min and max propeties of the vertical scroll bar:

verScroll.Min = 0
verScroll.Max = picInside.Height - picOutside.Height

This works great, except when verScroll.Max exceeds 32767!  The control array items listed below are there, just not accessible by the scroll bar.  Does anyone know how I can reach these other items?  Does anyone know a work around?  I'll consider using other controls if anyone has a different approach.

In case you're wondering, this is how I get the inner picture control and vertical scroll bar to work together:

Private Sub verScroll_Change()

    picInside.Top = -verScroll.Value

End Sub
0
MariaHalt
Asked:
MariaHalt
  • 3
  • 2
1 Solution
 
Mikal613Commented:
from Lee Weiner

He is the man

http://www.leeweiner.org/vb/scrllpic.zip
0
 
MariaHaltAuthor Commented:
That's what I'm doing.  

Referencing your code:

VScroll1.Max = Picture2.Height - Picture1.ScaleHeight

If Pictur2.Height - Picture1.ScaleHeight > 32767 an error overflow error occurs.

The problem is that the max value the scroll bar can be set to is 32767.  How can I work around this constraint?

0
 
MariaHaltAuthor Commented:
Percentages!!!  Why didn't I think of that???  Thanks for pointing me in the right direction!
0
 
Mikal613Commented:
no problem

Have fun
0

Featured Post

[Webinar] Database Backup and Recovery

Does your company store data on premises, off site, in the cloud, or a combination of these? If you answered “yes”, you need a data backup recovery plan that fits each and every platform. Watch now as as Percona teaches us how to build agile data backup recovery plan.

  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now