[RESOLVED] Adding all items from a listview to a listbox?
Hey guys I have two forms.
The antivirus form has a listview called report.
I have another form called antiignore that has a list1 listbox. Is there a way to get it so when I load the antiignore form, the items that are in the listview report goes in the list1?
Thank you!
Re: Adding all items from a listview to a listbox?
You want to transfer every item from the ListView to the ListBox? Which column do you want to transfer from the ListView? Should the items stay in the ListView?
Try this to see if it's what you want, otherwise, explain what it is you want a little more. ;)
Code:
Private Sub LVTransferAll(ByRef LVObject As Object, _
ByRef LBObject As Object)
Dim l As Long, c As Long
With LVObject
c = .ListItems.Count
If c > 0 Then
'LBObject.Clear 'Uncomment to clear ListBox first.
For l = 1 To c
LBObject.AddItem .ListItems(l).Text
Next l
End If
End With
End Sub
And to use it...
vb Code:
'Example:
Private Sub Command1_Click()
LVTransferAll report, list1
End Sub
Re: Adding all items from a listview to a listbox?
Re: [RESOLVED] Adding all items from a listview to a listbox?