
Help Needded How I Create Listbox That Look Like Multi Column Listbox
Public Declare Function SendMessageArray Lib "user32" Alias "SendMessageA"
_
????(ByVal hwnd As Long, _
?????ByVal wMsg As Long, _
?????ByVal wParam As Long, _
?????lParam As Any) As Long
Public Const LB_SETTABSTOPS = &H192
Sub Form_Load()
Dim r As Long
'set up the tabstops in the listboxes
ReDim tabstop(1 To 3) As Long
'assign some values to the tabs for the second, third and fourth
'column (the first is flush against the listbox edge)
tabstop(1) = 90
tabstop(2) = 130
tabstop(3) = 185
'set the tabs
r = SendMessageArray(List1.hwnd, LB_SETTABSTOPS, 3, tabstop(1))
List1.Refresh
End Sub
--
Randy Birch, MVP Visual Basic
Moderator, Fidonet Visual Basic Programmer's Conference
VBnet, The Visual Basic Developers Resource Centre
http://home.sprynet.com/sprynet/rasanen/
: I want to create Listbox that will show like the next format
:
: Code Name Location
: 100 Name1 Box1
: 102 Name2 Box1
: 103 Name3 Box1
: 104 Name4 Box1
: 105 Name5 Box1
:
: my problem is that the strings are not the same size so it look messy
: in C we solve this problem by useing Tabstops
: C code
: BaseUnit = (int)GetDialogBaseUnits();
: nTabStops=2;
: vTabStops[0]=BaseUnit*3;
: vTabStops[1]=vTabStops[0]+BaseUnit*3;
: SendDlgItemMessage(hDlg,LB_TESTS,LB_SETTABSTOPS,(WORD)nTabStops,(
: DWORD)(LPSTR)vTabStops);
:
: I dont know how to create the same thing in vb
: Any help will be greatly appreciate.
:
: --
: Avner Belisha
: