private void btnVerwijder_Click(object sender, EventArgs e) { foreach (ListViewItem item in lstItems.CheckedItems) { int index = item.Index; itemDAO.DeleteItem(Items[index]); lstItems.Items.Remove(item); } this.Items = itemDAO.GetAll(); }
private void btnVerwijder_Click(object sender, EventArgs e) { Item item = GeslecteerdeItems[lstItems.SelectedIndex]; itemDAO.DeleteItem(item); lstItems.Items.Clear(); if (btnDiner.BackColor == System.Drawing.Color.DimGray) { ToonLijstDiner(); } else if (btnDrank.BackColor == System.Drawing.Color.DimGray) { ToonLijstDrank(); } else if (btnLunch.BackColor == System.Drawing.Color.DimGray) { ToonLijstLunch(); } }