Results 1 to 8 of 8

Thread: [RESOLVED] Form Height vs Max VScroll

  1. #1

    Thread Starter
    Fanatic Member AccessShell's Avatar
    Join Date
    Oct 2013
    Posts
    790

    Resolved [RESOLVED] Form Height vs Max VScroll

    It seems I can make a form height much greater than about 32000. My current form height is about 60000.
    It seems I can make a Frame height much greater than about 32000. My current form height is about 60000.

    That's great, because I need to scroll vertically. However, I cannot. The VScroll control allow a max of only about 32000.

    Is there a work around?

    Thanks

  2. #2
    Addicted Member
    Join Date
    Jul 2021
    Posts
    165

    Re: Form Height vs Max VScroll

    One option will be to set min=-30000 max=30000 and offset the value by 30000.
    Other option is to multiply value by 2 (if you don't need precise value).
    Third option to set scalemode to pixels instead of twips.
    Last edited by Dry Bone; Nov 28th, 2023 at 05:22 PM.

  3. #3

    Thread Starter
    Fanatic Member AccessShell's Avatar
    Join Date
    Oct 2013
    Posts
    790

    Re: Form Height vs Max VScroll

    Thank you Dry Bone. I did suggestions 1 and 3. After some playing, I got it to work properly. I am now trying to get the tab on the VScroll bar to start at the top.

  4. #4

    Thread Starter
    Fanatic Member AccessShell's Avatar
    Join Date
    Oct 2013
    Posts
    790

    Re: [RESOLVED] Form Height vs Max VScroll

    On further analysis, the suggestion does not fully work. While I can now scroll the entire height of the data, I cannot:

    1. Get the VScroll.Value = 0 with the data at the top of the scroll frame, it is half way through
    2. When I reset for the data to be sorted differently, all the positioning is wrong. The first set of data is not at the top, and vscroll value is randomly positioned.

  5. #5
    Addicted Member
    Join Date
    Jul 2021
    Posts
    165

    Re: [RESOLVED] Form Height vs Max VScroll

    I explicitly said "offset the value by 30000".
    That means:
    * When you get value - you have to add 30000
    * When you set value - you have to subtract 30000

  6. #6

    Thread Starter
    Fanatic Member AccessShell's Avatar
    Join Date
    Oct 2013
    Posts
    790

    Re: [RESOLVED] Form Height vs Max VScroll

    Dry Bone as much as I try to understand you , I cannot.

    Here is what I Have.

    On my form I have a frame named fraScroll.
    On this frame I have 50 mini-frames called fraSQ(i), indexed 1 to 50.
    The mini-frames are 5 wide and 10 deep.

    The original code is as follows.

    Code:
    Private Sub VScroll1_Change()
    
        ScrollFrame
        
    End Sub
    
    
    Private Sub VScroll1_Scroll()
    
    
        ScrollFrame
    
    
    End Sub
    
    
    Private Sub ScrollFrame()
    Dim ctl As Control
        
        For Each ctl In Me.Controls
            If ctl.Container.Name = "fraScroll" Then
                ctl.Top = ctl.Top + (mlngOldPos - VScroll1.Value)
                DoEvents        'Try to smooth scrolling
            End If
        Next
    
    
        mlngOldPos = VScroll1.Value
       
    End Sub
    Where do I put the offset?

  7. #7
    Hyperactive Member
    Join Date
    Jan 2018
    Posts
    264

    Re: [RESOLVED] Form Height vs Max VScroll

    Moving all the frames around relative to their current position will get you nothing but frustration. First write a function that will return the correct position of each frame (by index) in your "60000" coordinates, then use that to set the Top or Visible values based on the scroll position.

  8. #8

    Thread Starter
    Fanatic Member AccessShell's Avatar
    Join Date
    Oct 2013
    Posts
    790

    Re: [RESOLVED] Form Height vs Max VScroll

    I did exactly what ahenry suggested. It was much easier than using a VScroll bar. And, of course, no frustration.

    Thanks - thread is finally closed

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width