Userform Vertical Scroll Bar to open at top of form

  • Hi again,


    Ive got my userform working once again!


    However the one minor irritation for me is that when the form with a vertical scrollbar opens up it always opens fully scrolled to the bottom of the form (where the command button to close is located). How can I make it so that the form always opens fully scrolled to the top?


    Ive tried putting various values in the "Scroll Top" property and "Scroll Height" property but I can only make it so that the form opens at the bottom or in the middle.


    Ive posted a screenshot of the form and its properties (although the image is quite low quality due to compression).


    Thanks for any help with this.
    Damian

  • Re: Userform Vertical Scroll Bar to open at top of form


    Andy thanks for your help once again!


    For some reason neither that bit of code or the "Scroll Top" property made any difference to the starting position of the scroll bar on the form.


    Maybe it was something to do with the fact that the form gets opened through a command button on an information box?


    Anyway once I removed the command button from the bottom of the form, the scroll top property worked once again and the form opens up at the top.

  • Re: Userform Vertical Scroll Bar to open at top of form


    I see, yes the command button probably has the focus when the userform is displayed so it helpfully brings it into sight.
    This should set it back to the top.
    [vba]Private Sub UserForm_Activate()


    Me.ScrollTop = 0


    End Sub[/vba]Another option may be to but the control containing the text within a frame. And have a frame with scroll rather than the userform.

    [h4]Cheers
    Andy
    [/h4]

  • Re: Userform Vertical Scroll Bar to open at top of form


    after adding all the text boxes command buttons and other things on vb10 form now i want to put horizantal and vertical scroll bar .May i know how it can be done.I also put all these objects in a group box .

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!