Results 1 to 7 of 7

Thread: Listbox control

  1. #1

    Thread Starter
    Member
    Join Date
    Jun 2000
    Posts
    39
    Does anyone know if there's an alternative to the usual Listbox control which allows list items to be > 1024 characters and creates a horizontal scroll bar when necessary? (The Listbox control that ships with VB6 Enterprise SP4 does not support either of these characteristics).

    Any help is greatly appreciated,

    Nahid Harjee

  2. #2
    Guest
    Try the TreeView or the ListView Controls that are part of MicroSoft Windows Common Controls 6.0

  3. #3

  4. #4

    Thread Starter
    Member
    Join Date
    Jun 2000
    Posts
    39
    Thanks Martin,

    That code for the horizontal scroll bar is perfect... now if I could only find a way for the ListBox to accept strings 1024+ characters in length.

  5. #5

  6. #6

    Thread Starter
    Member
    Join Date
    Jun 2000
    Posts
    39
    Ok, I'll drop him a line.

    Thanks again.

  7. #7
    Guest
    Adding a horizontal line to a listbox:

    Code:
    Const WM_USER = 1024
    Const LB_SETHORIZONTALEXTENT = (WM_USER + 21)
    Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hWnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As Any) As Long
    
    nNewWidth = list1.Width + 100
    nRet = SendMessage(list1.hWnd, LB_SETHORIZONTALEXTENT, nNewWidth, ByVal 0&)

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