private void deleteGameBtn_Click(object sender, EventArgs e) { if (gameLstBox.SelectedItem != null) { VideoGame gameToBeDeleted = (VideoGame)gameLstBox.SelectedItem; VideoGameDb.Delete(gameToBeDeleted); gameLstBox.Items.Clear(); List <VideoGame> games = VideoGameDb.GetVideoGames(); foreach (VideoGame g in games) { gameLstBox.Items.Add(g); } } }