Cloning Listviews

I'm wondering how to accomplish a complete clone of Listview entries, with all subitems and icon settings. Is this possible without explicitly going through all variables?

E.G. Listview2.entry(x) = Listview1.entry(y)

[230 byte] By [ritzratz] at [2007-12-28]
# 1

The best you will do is to iterate through the list and clone the items:

For Each lvi As ListViewItem In Me.ListView1.Items

Me.ListView2.Items.Add(lvi.Clone)

Next

In order to get the images to show up properly you must set the listview2 imagelist to the same imagelist as listview1

DMan1 at 2007-9-4 > top of Msdn Tech,Visual Basic,Visual Basic IDE...
# 2

Indeed. :)

Thank you.

ritzratz at 2007-9-4 > top of Msdn Tech,Visual Basic,Visual Basic IDE...