Results 1 to 3 of 3

Thread: Hello

  1. #1

    Thread Starter
    Member
    Join Date
    Aug 2002
    Location
    Pakistan
    Posts
    32

    Exclamation Hello

    Can anyone help me in finding a listbox with a vertical scroll bar .... the one which Vb 6.0 have has only the horizontal one ....... soooooooooooo plzzzzzzz

    Am waiting
    You'll get life just for once so don't waste it .......

  2. #2
    PowerPoster
    Join Date
    Aug 2001
    Location
    new jersey
    Posts
    2,904
    please read "how to get your questions answered" at the top of this thread. "hello" does not help anyone figure out what the topic of your problem is.

  3. #3
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333
    Use the standard listbox, and add your own horizontal scroll bar.
    VB Code:
    1. 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.  
    3. Private Const LB_SETHORIZONTALEXTENT = &H194
    4.  
    5. Private Sub AddHScroll(LB As ListBox)
    6.      
    7.      Dim i As Long
    8.      Dim lLength As Long
    9.      Dim lWdith As Long
    10.      
    11.      'see what the longest entry is
    12.      For i = 0 To LB.ListCount - 1
    13.          If Len(LB.List(i)) = Len(LB.List(lLength)) Then
    14.              lLength = i
    15.          End If
    16.      Next i
    17.      
    18.      'add a little space
    19.      lWdith = LB.Parent.TextWidth(LB.List(lLength) + Space(5))
    20.      
    21.      'Convert to Pixels
    22.      lWdith = lWdith \ Screen.TwipsPerPixelX
    23.  
    24.      'Use api to add scrollbar
    25.      Call SendMessage(LB.hwnd, LB_SETHORIZONTALEXTENT, lWdith, ByVal 0&)
    26.  
    27.  End Sub

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width