倒着删,不会出错
for (int i = this.listBox1.SelectedIndices.Count - 1; i >= 0; i--)
{
int currentIndex = this.listBox1.SelectedIndices[i];
listBox1.Items.RemoveAt(currentIndex);
}
for (int i = this.listBox1.SelectedIndices.Count - 1; i >= 0; i--)
{
int currentIndex = this.listBox1.SelectedIndices[i];
listBox1.Items.RemoveAt(currentIndex);
}