Solved

Add scrobar to listbox

Posted on 1998-10-04
4
192 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
Comment Utility
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
Comment Utility
How to get widthofScrollbar?
0
 
LVL 9

Expert Comment

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

scwidth = List1.Width / Screen.TwipsPerPixelX
0
 

Author Comment

by:wallacjb
Comment Utility
Thanks.
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Introduction While answering a recent question (http://www.experts-exchange.com/Q_27402310.html) in the VB classic zone, I wrote some VB code in the (Office) VBA environment, rather than fire up my older PC.  I didn't post completely correct code o…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
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…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

771 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

11 Experts available now in Live!

Get 1:1 Help Now