I'd like to move items from one list view to another. adding them to the second one works but the moved entries don't get removed at all.
private void MoveSelItems(ListBox from, ListBox to)
{
for (int i = 0; i < from.SelectedItems.Count; i++)
{
to.Items.Add(from.SelectedItems[i].ToString());
}
from.Items.Remove(to.SelectedItem);
}
I'm using C# / Winforms / -NET 3.5
Try this code instead at the end of the loop
Though
Items.RemoveAt(i) is probably faster, if that matters.
You may need to create a holding list.