Add scrobar to listbox

How do you add a horizontal scallbar to a list box?
wallacjbAsked:
Who is Participating?
 
DalinConnect With a Mentor Commented:
Wallacjb,
Try this: If you have questions, let me know.
Regards
Dalin


1. API Declare

     Const LB_SETHORIZONTALEXTENT = &H194
     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

2. When you want add the scrollbar, add

        
   Call SendMessage(List1.hwnd, LB_SETHORIZONTALEXTENT, widthofScrollbar, ByVal 0&)

    ' width is in pixel
0
 
wallacjbAuthor Commented:
How to get widthofScrollbar?
0
 
DalinCommented:
Sorry.  I should have added it to my bank. This happed before.

scwidth = List1.Width / Screen.TwipsPerPixelX
0
 
wallacjbAuthor Commented:
Thanks.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.