// Function: Clear selected item(s) private void menuStripMenuItem_Click(object sender, EventArgs e) { if (listView1.SelectedItems.Count != 0) { foreach (ListViewItem LItem in listView1.SelectedItems) { LItem.Remove(); } } }
private void bookReturnedToolStripMenuItem_Click(object sender, EventArgs e) { if (listView1.SelectedItems.Count != 0) { foreach (ListViewItem LItem in listView1.SelectedItems) { DialogResult dr = MessageBox.Show("Do You Want to Remove it from the list?", "", MessageBoxButtons.YesNo, MessageBoxIcon.Warning); if (dr == DialogResult.Yes) { LItem.Remove(); //UPDATE TABLE } } } }