Results 1 to 3 of 3

Thread: VB - Adding Horizontal Scroll Bar to controls such as listbox

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Feb 2003
    Posts
    79

    VB - Adding Horizontal Scroll Bar to controls such as listbox

    VB Code:
    1. 'Declaring the SendMessage API - To send a Message to other Windows
    2. Private Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hWnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As Any) As Long
    3. Const LB_SETHORIZONTALEXTENT = &H194 'Set the Horizontal Bar to 2 times its Width
    4. Dim lngReturn As Long
    5. Dim lngExtent As Long
    6. lngExtent = 2 * (Form1.List1.Width / Screen.TwipsPerPixelX)
    7. lngReturn = SendMessage(Form1.List1.hWnd, LB_SETHORIZONTALEXTENT, lngExtent, 0&)
    Last edited by Bow-Viper1; Mar 1st, 2003 at 04:29 PM.

  2. #2
    Hyperactive Member BrandonTurner's Avatar
    Join Date
    Sep 2001
    Location
    East Lansing, Michiagn
    Posts
    268

    Re: VB - Adding Horizontal Scroll Bar to controls such as listbox

    Originally posted by Bow-Viper1
    VB Code:
    1. 'Declaring the SendMessage API - To send a Message to other Windows
    2. Public Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hWnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As Any) As Long
    3. Public Const LB_SETHORIZONTALEXTENT = &H194 'Set the Horizontal Bar to 2 times its Width
    4. Dim lngReturn As Long
    5. Dim lngExtent As Long lngExtent = 2 * (Form1.List1.Width / Screen.TwipsPerPixelX) lngReturn = SendMessage(Form1.List1.hWnd, LB_SETHORIZONTALEXTENT, _ lngExtent, 0&)


    VB Code:
    1. 'Declaring the SendMessage API - To send a Message to other Windows
    2. Private Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hWnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As Any) As Long
    3. Const LB_SETHORIZONTALEXTENT = &H194 'Set the Horizontal Bar to 2 times its Width
    4. Dim lngReturn As Long
    5. Dim lngExtent As Long
    6. lngExtent = 2 * (Form1.List1.Width / Screen.TwipsPerPixelX)
    7. lngReturn = SendMessage(Form1.List1.hWnd, LB_SETHORIZONTALEXTENT, lngExtent, 0&)

  3. #3

    Thread Starter
    Lively Member
    Join Date
    Feb 2003
    Posts
    79
    thanks, still getting used to these vbcode tags

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