private void detailBtn_Click(object sender, EventArgs e) { if (filmList.SelectedItems.Count == 0) { MessageBox.Show("Select a movie"); } else { FilmDetail frm6 = new FilmDetail(filmList.SelectedItem.ToString(), ref usr_, this); frm6.Show(); this.Closed += (s, args) => frm6.Close(); } }
private void detailsBtn_Click(object sender, EventArgs e) { if (results.SelectedItems.Count > 1) { MessageBox.Show("Cannot select more than one movie"); } else if (results.SelectedItems.Count == 0) { MessageBox.Show("Select a movie"); } else { FilmDetail frm6 = new FilmDetail(results.SelectedItems[0].Text, ref usr_, frm4_); frm6.Show(); frm4_.Closed += (s, args) => frm6.Close(); //when users sign out, close the movie info page } }