|
-
Jun 24th, 2001, 06:37 AM
#1
Multiple Column List Box
I am trying to find out how to do one of those list boxes you get in many programs that list files and their details. Things like the find file box in windows, where you have the multiple column list box showing the results, with column headers that are buttons you can use to re order the list, and the user can adjust the width of the columns by dragging them like you do in Excel.
I have had a look at the components list but i cant find anything like it.
Any ideas?
Thanks
-
Jun 24th, 2001, 06:45 AM
#2
Addicted Member
The ListView control is what toy're looking for, it is part of the Microsoft Common Controls 6.0 in the components list.
(mscomctl.ocx)
-
Jun 24th, 2001, 06:46 AM
#3
This sets 2 tabs (3 columns counting the first one on the left )in the listbox
usage:
List1.Additem "column1" & chr(9) & "column2" & chr(9) & "column3"
Code:
const LB_SETTABSTOPS = &H192 ' set tabs in listbox
Private Declare Function SendMessageArray Lib "user32" Alias "SendMessageA" _
(ByVal hwnd As Long, ByVal wMsg As Long, _
ByVal wParam As Long, lParam As Any) As Long
Sub SetListBoxTabs()
Dim TabStop(0 To 1) As Long
TabStop(0) = 55
TabStop(1) = 300
'clear tabs
Call SendMessageArray(List1.hwnd, LB_SETTABSTOPS, 0&, ByVal 0&)
' set tabs
Call SendMessageArray(List1.hwnd, LB_SETTABSTOPS, 2, TabStop(0))
DoEvents
List1.Refresh
End Sub
-
Jun 24th, 2001, 06:51 AM
#4
Addicted Member
That will make it "look" like it has columns, but the ListBox does not support columns that can be resized or sorted.
-
Jun 24th, 2001, 07:26 AM
#5
I have got the listview on a form but it is very different from the list box and i cant find much in info in msdn about and the site search doest appear to be working. I am having trouble working it out, so could someone just give me some of the basic code you need for it please.
eg, adding columns with headers, adding list items, deleting items, referencing etcs.
Thanks
-
Jun 24th, 2001, 07:42 AM
#6
Addicted Member
I havn't used one in a while, but I think that setting up columns has to be done in design time by choosing Custom in the Properties window, you can do a lot from there.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|