I have a from created to fill out and print. I have the form size set but when I run the program I cant scroll down to fill out the bottom part of the form. I have added a vertical scroll bar to my for but it does not move the form on the screen. What am I missing?


Recommended Answers

All 9 Replies

Place the scroll bar on the form, take everything else and place them in a frame. make sure the frame is the max height you need.

Then you can do something like this,

Private Sub Form_Load()
VScroll1.Max = (Frame1.Height - Me.Height) + 500
VScroll1.SmallChange = 50
VScroll1.LargeChange = 100
End Sub

Private Sub VScroll1_Change()
Frame1.Top = "-" & VScroll1.Value
End Sub

- Mike

Thanks for the reply Mike.

I get a run time error type 13, type mismatch on this line.

Frame1.Top = "-" & VScroll1.Value

What is the "-" doing?

Thanks - John

The line replaces the Frame1.Top to the negative value of VScroll1.value

Try Frame1.Top = 0 - VScroll1.Value

that would work better...:)

Thanks guys. Ok so now the scroll bar works but as soon as I scroll down (even one click) all of my text disappears! I am so lost on this!
Are all scrolling windows pages created on a frame? What if I create a MDIchild?


You could try changing these 2 settings
VScroll1.SmallChange = 50
VScroll1.LargeChange = 100

If you make your form into a MDI child, then the MDIform will supply scroll bars to view the MDI child forms.

either way will work.


Please give my best thanks Mike
You help me very much by writng this some line code.
truely yours

What is the meaning of the code below :
VScroll1.Max = (Frame1.Height - Me.Height) + 500
VScroll1.SmallChange = 50
VScroll1.LargeChange = 100

VScroll1.Max = (Frame1.Height - Me.Height) + 500 <= This is used to set the max on the vertical scroll bar. I used a frame control and extended it beyond the height of the form, so to get the difference (distance needed to move) I subtracted the height of the frame from the height of the form. But since the frame is not the exact height of the form, due to the titlebar on the form, I just add another 500 to the distance.

example: VScroll1.Max = (2000 - 1500) + 500 = 1000

VScroll1.SmallChange = 50 <= This is the distance to move the frame when you use the arrows on the scroll bar

VScroll1.LargeChange = 100 <= This is the distance to move the frame when you click on the scroll bar to jump down or up.

I hope this helped a little.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, learning, and sharing knowledge.