Results 1 to 2 of 2

Thread: Applying Scrollbars to a Form Object

  1. #1

    Thread Starter
    New Member
    Join Date
    May 1999
    Location
    Karachi, Pakistan
    Posts
    5

    Post

    How can I apply ScrollBars to a FOrm Object.

    Thanks in Advance........


  2. #2
    Junior Member
    Join Date
    Oct 1999
    Posts
    16

    Post

    If, by your question, you wish to have a scroll area set up (i.e. as scroll bar value changes objects move on form); no problem.

    Take one picture box (lets call it pic_ScrollArea). In side this picture box place your controlls (i.e. cmd, txt, lbl, ect...).

    Create another picture box (lets call it pic_ViewPort). Now select pic_ScrollArea. Right click. Select cut. Now select pic_ViewPort. Right click. Seclect paste.

    You now have a picture box inside a picture box.

    Add 1 horizontal scroll bar and 1 verticle scroll bar.

    Now add this code to your form:
    '
    '
    ' <<< Scroll Bars >>>
    '
    Private Sub VScroll1_Change()
    pic_ScrollArea.Top = -VScroll1.Value
    End Sub
    '
    Private Sub HScroll1_Change()
    pic_ScrollArea.Left = -HScroll1.Value
    End Sub
    '
    Private Sub VScroll1_Scroll()
    pic_ScrollArea.Top = -VScroll1.Value
    End Sub
    '
    Private Sub HScroll1_Scroll()
    pic_ScrollArea.Left = -HScroll1.Value
    End Sub

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