F
farmer
I need to populate a listbox of other listview with selected listview
items.although the following code works perfecty I want to use an
Array (for various reasons)
for Each ListItem In listview1.ListItems
If ListItem.Checked = True Then
listbox1.AddItem ListItem.Text
next
So I'm trying to fill an array with listview items. (I need only the
first Item)
Here is The code
Dim varrSel()
Dim i As Integer
Dim cnt As Integer
For Each ListItem In listview1.ListItems
If ListItem.Checked = True Then
cnt = cnt + 1
ReDim Preserve varrSel(1 To cnt)
varrSel(cnt) = ListItem.Text
End If
Next
listbox1.List = varrSel
The only problem is that I can't get it to work
DOES ANYONE HAS A SUGGESTION OF WHAT'S WRONG WITH THE CODE??
items.although the following code works perfecty I want to use an
Array (for various reasons)
for Each ListItem In listview1.ListItems
If ListItem.Checked = True Then
listbox1.AddItem ListItem.Text
next
So I'm trying to fill an array with listview items. (I need only the
first Item)
Here is The code
Dim varrSel()
Dim i As Integer
Dim cnt As Integer
For Each ListItem In listview1.ListItems
If ListItem.Checked = True Then
cnt = cnt + 1
ReDim Preserve varrSel(1 To cnt)
varrSel(cnt) = ListItem.Text
End If
Next
listbox1.List = varrSel
The only problem is that I can't get it to work
DOES ANYONE HAS A SUGGESTION OF WHAT'S WRONG WITH THE CODE??