vbCity
Migrating to the new kind of Visual Basic Developer Community

Passing listview item to another listview...

Latest post 03-19-2009 11:58 PM by XTab. 1 replies.
  • 03-19-2009 8:50 PM

    Passing listview item to another listview...

    hi good day..how do i dot this..i have a listview box where all my items are shown..what i want to happen is when i click this item it automatically goes to my other listview box...im still new at this can someone here please help me..
  • 03-19-2009 11:58 PM In reply to

    • XTab
    • Not Ranked
    • Joined on 02-21-2002
    • Dumfries, Scotland
    • Posts 8,585

    Re: Passing listview item to another listview...

    Hi

    Welcome to vbCity!

    ListViews can be a bit weird and you often have to jump through hoops to do what seems like straightforward things. This is one of those cases.

    Try this:

      
    Code:
    Private Sub ListView1_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles ListView1.SelectedIndexChanged
            Dim lvi As New ListViewItem
            If ListView1.SelectedItems.Count > 0 Then
                lvi = ListView1.SelectedItems(0)
                Dim lvi2 As New ListViewItem
                lvi2 = CType(lvi.Clone, ListViewItem)
                ListView2.Items.Add(lvi2)
            End If
         
        End Sub




    ----------------------------------------------------------------------------
    XTab : Microsoft MVP (Visual Developer - Visual Basic)
    For (Sometimes) Useful Hints and Tips, Check Out My VBCity Blog
             

Page 1 of 1 (2 items) | RSS
Copyright 1998-2009 vbCity.com LLC