从ListView删除选定的项目 [英] Remove the Selected Item From ListView

查看:47
本文介绍了从ListView删除选定的项目的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何从列表视图中删除所选项目?

How can I remove a selected item from a listview?

推荐答案

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

其中listView1是您的列表视图的ID.

where listView1 is the id of your listview.

这篇关于从ListView删除选定的项目的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆