Evo ga kôd:
Dim lvi As New ListViewItem, lvi2 As New ListViewItem
If lst_vrstaArt1.SelectedItems.Count > 0 Then
For i As Integer = 0 To lst_vrstaArt1.SelectedItems.Count - 1
lvi = lst_vrstaArt1.SelectedItems(i)
lvi2 = CType(lvi.Clone, ListViewItem)
lst_vrstaArt2.Items.Add(lvi2)
Next
End If
A evo i kakvu mi grešku izbaci na "lvi = lst_vrstaArt1.SelectedItems(i)":
An unhandled exception of type 'System.InvalidCastException' occurred in test.exe
Additional information: Unable to cast object of type 'System.String' to type 'System.Windows.Forms.ListViewItem'.
Now they have two problems!
-Jamie Zawinsky