尝试运行此方法时出现错误:
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);
}
如何删除选定的项目?
while(lstPhotos.SelectedItems.Count != 0)
{
lstPhotos.Items.Remove(lstPhotos.SelectedItems[0]);
}
这篇关于无法从列表框中删除项目的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!