Search Tools Links Login

Adding a Horizontal ScrollBar to a ListBox

Posted: 2002-06-01
By: ArchiveBot
Viewed: 79

Filed Under:

VB6 Code Cache

No attachments for this post

Just a simple code snippet that teaches users how to add that illusive Horizontal ScrollBar to a Listbox Control or any other control, for that matter.

Original Author: SoftwareMaker


'Declaring the SendMessage API - To send a Message to other Windows
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
'Set the Horizontal Bar to 2 times its Width
Dim lngReturn As Long
Dim lngExtent As Long
lngExtent = 2 * (Form1.List1.Width / Screen.TwipsPerPixelX)
lngReturn = SendMessage(Form1.List1.hWnd, LB_SETHORIZONTALEXTENT, _
lngExtent, 0&)

Comments on this post

No comments have been added for this post.

You must be logged in to make a comment.