Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 1 of 1
08-09-2012, 05:12 AM #1
- Join Date
- Aug 2011
- Thanked 0 Times in 0 Posts
[VB.NET] Adding selected item from listview1 to listview2
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
Last edited by kor81; 08-09-2012 at 05:58 PM.