Exemplo n.º 1
0
        /// <summary>
        /// This function describes what happens when you click the WatchMovieButton
        /// </summary>
        private void WatchMovieButton_Click(object sender, EventArgs e)
        {
            Movie seeThisMovie = new Movie();

            seeThisMovie = (Movie)listBoxTitle.SelectedItem;

            if (seeThisMovie != null)
            {
                WatchMovie watchMovieForm = new WatchMovie(seeThisMovie.CompendiumNumber, seeThisMovie.Title);
                watchMovieForm.ShowDialog();
            }

            else
            {
                MissingInfoForm noMovie = new MissingInfoForm("You have not selected a movie!");
                noMovie.ShowDialog();
                return;
            }
        }
Exemplo n.º 2
0
        private void listBoxTitle_KeyDown(object sender, KeyEventArgs e)
        {
            if (e.KeyData == Keys.Enter)
            {
                Movie seeThisMovie = new Movie();

                seeThisMovie = (Movie)listBoxTitle.SelectedItem;

                if (seeThisMovie != null)
                {
                    WatchMovie watchMovieForm = new WatchMovie(seeThisMovie.CompendiumNumber, seeThisMovie.Title);
                    watchMovieForm.ShowDialog();
                }

                else
                {
                    MissingInfoForm noMovie = new MissingInfoForm("You have not selected a movie!");
                    noMovie.ShowDialog();
                    return;
                }
            }
        }