Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium


hscrollbars with listbox with checkbox property enabled

Posted on 2005-02-28
Medium Priority
Last Modified: 2010-05-18
Is it possible to have a horizontal scroll baR with the check box style enabled???
Question by:keboone
  • 2

Expert Comment

ID: 13427034
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

' Set the horizontal extent of the control (in pixel).
' If this value is greater than the current control's width
' an horizontal scrollbar appears.

Sub SetHorizontalExtent(lb As ListBox, ByVal newWidth As Long)
    SendMessage lb.hwnd, LB_SETHORIZONTALEXTENT, newWidth, ByVal 0&
End Sub

'The LB_GETHORIZONTALEXTENT message is useful to retrieve the current value of the horizontal extent:


' Return the horizontal extent of the control (in pixel).

Function GetHorizontalExtent(lb As ListBox) As Long
    GetHorizontalExtent = SendMessage(lb.hwnd, LB_GETHORIZONTALEXTENT, 0, _
        ByVal 0&)
End Function



Private Sub Form_Load()
SetHorizontalExtent List1, 200
End Sub

Accepted Solution

elmer88techteam earned 375 total points
ID: 13427050
forgot to acknowledge...

source from http://www.devx.com/vb2themax/Tip/18591

Featured Post

[Webinar] Database Backup and Recovery

Does your company store data on premises, off site, in the cloud, or a combination of these? If you answered “yes”, you need a data backup recovery plan that fits each and every platform. Watch now as as Percona teaches us how to build agile data backup recovery plan.

Question has a verified solution.

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

Although it can be difficult to imagine, someday your child will have a career of his or her own. He or she will likely start a family, buy a home and start having their own children. So, while being a kid is still extremely important, it’s also …
No other job is as rewarding and demanding as building an iPhone app is. It is not really in the hands of the developer for the success of an iPhone app. Many factors operate jointly for every iOS application's success in the market.
In this fifth video of the Xpdf series, we discuss and demonstrate the PDFdetach utility, which is able to list and, more importantly, extract attachments that are embedded in PDF files. It does this via a command line interface, making it suitable …
With the power of JIRA, there's an unlimited number of ways you can customize it, use it and benefit from it. With that in mind, there's bound to be things that I wasn't able to cover in this course. With this summary we'll look at some places to go…

581 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