Need to exceed vertical scroll bar max allowed height

Posted on 2004-11-08
Last Modified: 2008-03-10
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
Question by:MariaHalt
    LVL 48

    Expert Comment

    from Lee Weiner

    He is the man

    Author Comment

    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?

    LVL 48

    Accepted Solution


    Author Comment

    Percentages!!!  Why didn't I think of that???  Thanks for pointing me in the right direction!
    LVL 48

    Expert Comment

    no problem

    Have fun

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    How your wiki can always stay up-to-date

    Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
    - Increase transparency
    - Onboard new hires faster
    - Access from mobile/offline

    Suggested Solutions

    Title # Comments Views Activity
    Windows 10 SmartScreen vs ClickOnce app 5 88
    hasOne  challenge 59 63
    countAbc challenge 9 35
    firstChar challenge 13 55
    This article is meant to give a basic understanding of how to use R Sweave as a way to merge LaTeX and R code seamlessly into one presentable document.
    If you’re thinking to yourself “That description sounds a lot like two people doing the work that one could accomplish,” you’re not alone.
    An introduction to basic programming syntax in Java by creating a simple program. Viewers can follow the tutorial as they create their first class in Java. Definitions and explanations about each element are given to help prepare viewers for future …
    In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

    760 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    7 Experts available now in Live!

    Get 1:1 Help Now