Click to See Complete Forum and Search --> : Ken_Lee


Ken_Lee
September 22nd, 1999, 09:56 PM
To Whom May Concern:

I am currently developing an application where I need to use vertical scroll bar.But hte thing is, I have try my best but still I failed. This is the situation:

1) create a form with the width 5000
2) the form height is 5000
3) a text box with caption text1 and place the text box with left 150 and
top as 7560.
4) a vertical scroll bar in the form

can you please guide me how to scroll the text box until it is visible.

Thank you

From
Ken

kbacheld
September 23rd, 1999, 11:44 AM
OK... If I understand this correctly, change the Vertical Scroll Bar's SmallChange AND LargeChange Properties to 50, the Max to 5000, and the Value to 5000. Change the TextBox's top to 5000. Put the following code in your form:



private Sub VScroll1_Change()
Text1.Top = VScroll1.Value
End Sub



(If your Vertical Scroll bar is named VScroll1.)

The only thing with this is that if you use the bar in the Vertical Scroll to move the text box (instead of the arrows), the Textbox will not actually change positions until you have released the sliding bar (the VScroll1_Change is not called until AFTER the MouseUp event has taken place).

Good Luck...

Kurt