Remove the Selected Item From ListView

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

How can I remove a selected item from a listview?

7条回答
  •  执念已碎
    2021-01-18 07:09

    foreach ( ListViewItem eachItem in listView1.SelectedItems)
    {
        listView1.Items.Remove(eachItem);
    }
    

    where listView1 is the id of your listview.

提交回复
热议问题