Uha... den er lidt slem. Men den kan overkommes ved at gøre følgende (Med tak til Jim McNamara på VBForums.COM):
This code sets several tab stops - the way to make columns. You have to put chr(9) in the text where you want a new column to start.
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
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 'first 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.Refresh
Det er temmelig besværligt - det eneste fornuftige alternativ er at køre med de allerede definerede tabstops og så sætte ID forrest, altså "ID & vbTab & Navn".
Prøv med ListView-kontrollen.. Det er en pendent til Listbox'en i Access, der bare har flere faciliteter.
Søg evt. på Listview på codehound.com, der er masser af eksempler!!
mvh Lars
Synes godt om
Ny brugerNybegynder
Din løsning...
Tilladte BB-code-tags: [b]fed[/b] [i]kursiv[/i] [u]understreget[/u] Web- og emailadresser omdannes automatisk til links. Der sættes "nofollow" på alle links.