0

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?

Thanks

5
Contributors
9
Replies
15
Views
10 Years
Discussion Span
Last Post by cricket2030
0

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

0

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

0

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

Try Frame1.Top = 0 - VScroll1.Value

0

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?

John

0

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.

-Mike

0

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

0

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

0

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.
-Mike

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.