Remove the Selected Item From ListView

前端 未结 7 1654
野的像风
野的像风 2021-01-18 06:29

How can I remove a selected item from a listview?

7条回答
  •  傲寒
    傲寒 (楼主)
    2021-01-18 07:02

    listView1.Items.Cast().Where(T => T.Selected)
        .Select(T => T.Index).ToList().ForEach(T => listView1.Items.RemoveAt(T))
    

提交回复
热议问题