| VB 4/6- und VBA-Forum - Beitragsübersicht - |
|
| Von |
It's me |
| Datum |
30. September 2015 um 19:40:06 |
| Frage |
Hallo ich such nach einer lösung wie man eine Listbox mehrspaltig auslesen kann. Ich finde nichts und da dacht ihr wisst sicher Rat.Option Explicit 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 Public Sub ListBox_SetTabStop(ByVal oList As Object, ParamArray vTabValue()) Dim nCount As Long Dim nTab() As Long Dim i As Long nCount = UBound(vTabValue) + 1 ReDim nTab(1 To nCount) For i = 1 To nCount nTab(i) = vTabValue(i - 1) Next i SendMessage oList.hwnd, LB_SETTABSTOPS, nCount, nTab(1) End Sub Private Sub Form_Load() ListBox_SetTabStop List1, 170, 250 List1.AddItem "Google" & vbTab & "www.google.com" & vbTab & "such & find" List1.AddItem "VB-Fun" & vbTab & "http://www.vb-fun.de/cgi-bin/loadframe.pl?ID=vb/forum/vbforum.shtml" & vbTab & "VB Forum" End Sub Private Sub Label1_Click(Index As Integer) Label2.Caption = List1.List(Label1(Index, 1).Index) 'List1.List(0, 0) so hab ich das im inet gefunden, funktioniert aber nicht zumindest nicht im VB6 End Sub Ich möchte gern das Spalte(0) in Label1(index).Index geschrieben wird, Spalte(1) in Label2.Caption und Spalte(2) in Label3.Caption
Vielen dank schon mal |
|