日期:2014-05-18 浏览次数:21399 次
private void Form1_Load(object sender, EventArgs e) { for (int i = 0; i < 10; i++) listView1.Items.Add(i + ""); } //删除勾选复选框的项 private void button1_Click(object sender, EventArgs e) { foreach(ListViewItem lvi in listView1.CheckedItems) { lvi.Remove(); } }
------解决方案--------------------
for (int i = listView1.Items.Count - 1; i >= 0; i--) { if (listView1.Items[i].Checked) listView1.Items.RemoveAt(i); }
------解决方案--------------------
listView1.Items.remove(lvi)