private void BtnPlay_Click(object sender, EventArgs e) { // todo: assignment 4 Song selectedSong = (Song)lbSongs.SelectedItem; listOfPlayedSongs.RegisterPlayed(selectedSong); }
private void BtnPlay_Click(object sender, EventArgs e) { // todo: assignment 4 Song selectedSong = (Song)lbSongs.SelectedItem; if (selectedSong != null) { lLOfPlayedSongs.RegisterPlayed(selectedSong); } else { MessageBox.Show("Please select a song from the list first!"); } }