When trying to run this method I get an error:
List that this enumerator is bound to has been modified. An enumerator can only be used if the list does not change.
foreach (var item in lstPhotos.SelectedItems)
{
lstPhotos.Items.Remove(item);
}
How can I remove the selected items?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…