Wrox Programmer Forums
|
VB How-To Ask your "How do I do this with VB?" questions in this forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the VB How-To section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old May 10th, 2005, 01:45 AM
Authorized User
 
Join Date: Jan 2005
Posts: 66
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via AIM to JelfMaria
Default Sroll bar

how to attach a horizontal scroll bar to a list box?

Thanks
Jelfy
__________________
Thanks
Jelfy
 
Old May 11th, 2005, 10:38 PM
Authorized User
 
Join Date: Jul 2003
Posts: 40
Thanks: 0
Thanked 1 Time in 1 Post
Default

      Option Explicit

      Private Declare Function SendMessageByNum Lib "user32" _
        Alias "SendMessageA" (ByVal hwnd As Long, ByVal _
        wMsg As Long, ByVal wParam As Long, ByVal lParam As Long) As Long
      Const LB_SETHORIZONTALEXTENT = &H194

      Private Sub Command1_Click()
         Dim s As String
         Static x As Long
         s = InputBox("Please enter any text", "List scroll", _
           "this is a simple scrollbar sample for demonstration purposes")
         List1.AddItem s
         If x < TextWidth(s & " ") Then
            x = TextWidth(s & " ")
           If ScaleMode = vbTwips Then _
               x = x / Screen.TwipsPerPixelX ' if twips change to pixels
           SendMessageByNum List1.hwnd, LB_SETHORIZONTALEXTENT, x, 0
         End If
      End Sub






Similar Threads
Thread Thread Starter Forum Replies Last Post
Sliding Bar scandalous Access 1 February 8th, 2007 01:04 PM
Status Bar ironchef Java GUI 0 October 26th, 2006 09:19 PM
How do disable Menu bar & address bar for browser bekim HTML Code Clinic 2 January 7th, 2005 12:33 AM
How to trap Mouse events on Title bar/Caption bar chiefouko Pro VB.NET 2002/2003 0 September 21st, 2004 02:42 AM
Bar Chart with Item names beside bar jmurdock BOOK: Professional SQL Server Reporting Services ISBN: 0-7645-6878-7 0 July 23rd, 2004 01:05 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.