...

View Full Version : Resolved [VB.NET] Adding selected item from listview1 to listview2



kor81
08-09-2012, 05:12 AM
This is the first time using listview and for the life of me i can't get it figured out.



Dim selectedItems = (From i In ListView2.SelectedItems)

For Each selectedItem In selectedItems

ListView1.Items.Add(selectedItem)
Label3.Text = "Fruit Basket: " & ListView1.Items.Count

Next


I Figured it out


Dim ItemI As ListViewItem
Dim ItemJ As ListViewItem
Dim PROG As Integer
Dim count As Integer
Dim PDC As Integer = kiword.ListView2.Items.Count

For i As Integer = kiword.ListView2.Items.Count - 1 To 0 Step -1
ItemI = kiword.ListView2.Items(i)
PROG = PROG + 1

For z As Integer = i + 1 To kiword.ListView2.Items.Count - 1 Step 1
itemj = kiword.ListView2.Items(z)
If itemI.Text = itemJ.Text Then
kiword.ListView2.Items.Remove(itemJ)
count = count + 1
Exit For
End If
Next z
Next (i)

Catch ex As Exception

End Try



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum