CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2

Thread: Ken_Lee

  1. #1
    Join Date
    Sep 1999
    Posts
    8

    Ken_Lee

    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


  2. #2
    Join Date
    Sep 1999
    Location
    Orlando, FL
    Posts
    3

    Re: Ken_Lee

    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



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

Featured