I got the following to compile:
ListViewItem[] dest = new ListViewItem[lv_Files.Items. Count];
// object[] dest = new object[lv_Files.Items. Count];
lv_Files.Items. CopyTo(dest, 0);
lv_SelectedFile s.Items.AddRang e(dest);
but get the following System.Argument Exception error in system.windows. forms.dll:
Additional information: Cannot add or insert the item 'filename.jpg' in more than one place. You must first remove it from its current location or clone it.
Any ideas? Thanks!
"Angel J. Hernández" <an**********@h otmail.com> wrote in message news:u5******** ******@tk2msftn gp13.phx.gbl...
Hi there... try this
object[] dest = new object[listBox1.Items. Count];
listBox1.Items. CopyTo(dest, 0);
listBox2.Items. AddRange(dest);
Regards,
--
Angel J. Hernández M.
MCSD
"CaffeineRu sh" <gr******@swbel l.net> escribió en el mensaje
news:3G******** *********@newss vr22.news.prodi gy.com... I have two Listview controls on the stage:
lv_Files
lv_SelectedFile s
I have a function that copies the selected items from lv_Files to
lv_SelectedFile s.
I am currently using a loop on the selected indices to copy. This is quite
a slow process when there are a lot of entries selected in lv_Files.
There is also a Copy All button that first selects all indices, then loops
through lv_Files, individually copying to lv_SelectedFile s.
Is there a method to perform this copy without the loop? Some faster
implementation? I have not been able to find any documention or code
examples for such.