1.SelectionMode 改成可以多选
2.利用KeyDown事件:
private void listBox1_KeyDown(object sender, KeyEventArgs e)
{
if (e.KeyCode == Keys.Delete)
{
for (int i = listBox1.SelectedItems.Count - 1; i > -1; i--)
{
listBox1.Items.Remove(listBox1.SelectedItems[i]);
}
}
}
C#中listbox中选中多项,并删除,布布扣,bubuko.com
原文地址:http://www.cnblogs.com/xieon1986/p/3841380.html