Solved

Add scrobar to listbox

Posted on 1998-10-04
4
193 Views
Last Modified: 2013-12-25
How do you add a horizontal scallbar to a list box?
0
Comment
Question by:wallacjb
  • 2
  • 2
4 Comments
 
LVL 9

Accepted Solution

by:
Dalin earned 250 total points
ID: 1487316
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
 

Author Comment

by:wallacjb
ID: 1487317
How to get widthofScrollbar?
0
 
LVL 9

Expert Comment

by:Dalin
ID: 1487318
Sorry.  I should have added it to my bank. This happed before.

scwidth = List1.Width / Screen.TwipsPerPixelX
0
 

Author Comment

by:wallacjb
ID: 1487319
Thanks.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I’ve seen a number of people looking for examples of how to access web services from VB6.  I’ve been using a test harness I built in VB6 (using many resources I found online) that I use for small projects to work out how to communicate with web serv…
Introduction While answering a recent question about filtering a custom class collection, I realized that this could be accomplished with very little code by using the ScriptControl (SC) library.  This article will introduce you to the SC library a…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

895 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now