Click to See Complete Forum and Search --> : Listview control
risaacso
April 27th, 2001, 09:52 AM
Does anyone have source code or know of a link (to a sample project) which allows you on a form with two listviews to select from one listview (for example, a set of names) and either drag to the second listview on the form or use the arrows (>, >>,<,<<) to select\deselect names and move from one listview to another.
I am sure this has been done thousands of time, and with current time contraints, don't really need to duplicate this code
Thanks is advance
R
slcotten
April 27th, 2001, 01:50 PM
Hi...
The following may or may not work as I am unable to test it right now but you could give it a try.
Dim NewListItem as ListItem
Dim ItemX as ListItem
for Each ItemX In ListView1.ListItems
set NewListItem = _
ListView2.ListItems.Add(,,ItemX.Text)
next ItemX
Not sure if that will work or even if it is what you're looking for...
actually while you're "trying things" :-) you could try this as well
set ListView2.ListItems = ListView1.ListItems
Later, I'll test things and see if those actually work. :-)
slcotten
April 27th, 2001, 05:05 PM
I just tested the code I gave you...
The fist example works... the second one does not...
Only I would do this in the for statement
Set NewListItem = ListView2.ListItems.Add(ItemX.Index, ItemX.Key, ItemX.Text, ItemX.Icon)
codeguru.com
Copyright Internet.com Inc., All Rights Reserved.