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]);
}
}
}

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-06-07
  • 2022-12-23
  • 2021-12-17
  • 2022-12-23
  • 2021-12-21
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-02-07
  • 2021-08-20
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案