I have two listviews on two different forms of the same program, and I want them to contain the same data. How do I get the data from frmMain.ListView1 to frmEdit.ListView1?
bob
Printable View
I have two listviews on two different forms of the same program, and I want them to contain the same data. How do I get the data from frmMain.ListView1 to frmEdit.ListView1?
bob
do you see the forms both at the same time or do you show one and unload or hide the other
Never mind. I got it. And both are visible, though it doesn't matter. Here's what I did:
where Players(0) is the original listview, frmMakeTeam is the second form, and PlayersEdit is the copied listview. I had the code on form_load of the copied form, adjusted a little, but it didn't work, so I tried putting it in the main original, and it did work.Code:For X = 1 To Players(0).ListItems.Count
Set Plad = frmMakeTeam.PlayersEdit.ListItems.Add(X, , Players(0).ListItems(X).Text)
Plad.SubItems(1) = Players(0).ListItems(X).SubItems(1)
Plad.SubItems(2) = Players(0).ListItems(X).SubItems(2)
Next X
Thanks though.
bob