Esempio n. 1
0
 // 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();
         }
     }
 }
Esempio n. 2
0
        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
                    }
                }
            }
        }