Results 1 to 3 of 3

Thread: Scroll Bars

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    May 2000
    Location
    England
    Posts
    135
    Hi,

    Can anyone please give me some code or tell me how to attach scroll bars to a form.

    Thanx,
    Sparky

  2. #2
    Addicted Member
    Join Date
    Aug 1999
    Location
    Hamilton, New Zealand
    Posts
    137

    Red face Use the standard VB Ones

    You can use the standard VB scroll bar to provide the graphical part of the scroll bar. Actually scrolling the contents of the form might be a bit harder.
    Regards

    Matt Brown
    Hamilton, NZ
    VB6 C++ in Visual Studio 6sp4
    VB.net Beta 1

  3. #3
    PowerPoster Chris's Avatar
    Join Date
    Jan 1999
    Location
    K-PAX
    Posts
    3,238

    Thumbs up

    you can do it with a single API function call

    Code:
    Option Explicit
    Private Declare Function ShowScrollBar Lib "user32" (ByVal hwnd As Long, ByVal wBar As Long, ByVal bShow As Long) As Long
    Private Const SB_BOTH = 3
    Private Const SB_HORZ = 0
    Private Const SB_VERT = 1
    
    Private Sub Form_Load()
    Dim ret&
    ret = ShowScrollBar(Me.hwnd, SB_BOTH, True)
    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