Hi !
how to set the list box so that it contains many fields.
for ex (2 fields):
file name Size
----------- ------
Test.exe 10k
ftp.lnk 1k
etc....
10x anyway !!
Printable View
Hi !
how to set the list box so that it contains many fields.
for ex (2 fields):
file name Size
----------- ------
Test.exe 10k
ftp.lnk 1k
etc....
10x anyway !!
As far as I can tell there is NO way. You should use the datagrid control to do such a thing...
This is my knowladge though...
I know, there is a way !!
i had the code ... but i dont have it anymore !!
anyway ...
anyone !?!?!? :(
VB Code:
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 Private Const LB_SETTABSTOPS = &H192 Private Sub Form_Load() ReDim TabStop(0 To 2) As Long 'assign some values to the tabs for the second third and fourth 'column (the first is flush against the listbox edge) TabStop(0) = 90 TabStop(1) = 130 TabStop(2) = 185 'clear then set the tabs Call SendMessage(List1.hwnd, LB_SETTABSTOPS, 0&, ByVal 0&) Call SendMessage(List1.hwnd, LB_SETTABSTOPS, 3, TabStop(0)) List1.AddItem "Big" & Chr(9) & "Brown" & Chr(9) & "Dog" List1.AddItem "Brown" & Chr(9) & "Big" & Chr(9) & "Dog" List1.AddItem "Dog" & Chr(9) & "Brown" & Chr(9) & "Big" List1.Refresh End Sub
VB Code:
List1.Columns = 2
but i have a feeling that isnt exactly what you wanted
Cool... Didn't knew that...Quote:
Originally posted by Hack
VB Code:
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 Private Const LB_SETTABSTOPS = &H192 Private Sub Form_Load() ReDim TabStop(0 To 2) As Long 'assign some values to the tabs for the second third and fourth 'column (the first is flush against the listbox edge) TabStop(0) = 90 TabStop(1) = 130 TabStop(2) = 185 'clear then set the tabs Call SendMessage(List1.hwnd, LB_SETTABSTOPS, 0&, ByVal 0&) Call SendMessage(List1.hwnd, LB_SETTABSTOPS, 3, TabStop(0)) List1.AddItem "Big" & Chr(9) & "Brown" & Chr(9) & "Dog" List1.AddItem "Brown" & Chr(9) & "Big" & Chr(9) & "Dog" List1.AddItem "Dog" & Chr(9) & "Brown" & Chr(9) & "Big" List1.Refresh End Sub