1 Attachment(s)
[RESOLVED] listBox - problem
Hi
I have something like this
Code:
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 Sub Command1_Click()
Unload Me
End Sub
Private Sub Form_Load()
Dim nTabArray(1) As Long 'Two tab stops (= 3 columns)
Const LB_SETTABSTOPS As Long = &H192
nTabArray(0) = 33
nTabArray(1) = 210
'Clear any existing tabs
'and set the list tabstops
Call SendMessage(List1.hwnd, LB_SETTABSTOPS, 0&, ByVal 0&)
Call SendMessage(List1.hwnd, LB_SETTABSTOPS, 2&, nTabArray(0))
List1.Refresh
'add some dummy data
List1.AddItem "1" & vbTab & "Apples" & vbTab & "$2.98"
List1.AddItem "2" & vbTab & "Chocolate" & vbTab & "$4.50"
List1.AddItem "3" & vbTab & "Yoghurt" & vbTab & "$4.90"
List1.AddItem "4" & vbTab & "Coffee" & vbTab & "$19.98"
List1.AddItem "5" & vbTab & "Mango" & vbTab & "$2.00"
List1.AddItem "6" & vbTab & "Bananas" & vbTab & "$1.89"
List1.AddItem "7" & vbTab & "Olives" & vbTab & "$7.12"
End Sub
Private Sub List1_Click()
Dim sItems() As String
Dim i As Long
sItems = Split(List1.Text, vbTab)
For i = 0 To 2
Text1(i).Text = sItems(i)
Next
End Sub
how to make that every clicking it can do wrote into the next row with textboxes with next numb er ordinal.