-
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
-
Try the TreeView or the ListView Controls that are part of MicroSoft Windows Common Controls 6.0
-
I believe that Aaron Young posted a way to add a horizontal scrollbar to the ListBox via the API. Do a search for Listbox and his name and you may find at least one of your answers.
-
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.
-
You might email him directly and ask.
-
Ok, I'll drop him a line.
Thanks again.
-
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&)