Exemple #1
0
        private void frmGenre_Load(object sender, EventArgs e)
        {
            try
            {
                List <Genre> genreList = Genres.GetGenres();
                genreDataGridView.DataSource = genreList;
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "Failure", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }

            ToolTip toolTip = new ToolTip();

            toolTip.SetToolTip(btnAdd, "Add Genre Name");
            toolTip.SetToolTip(btnBrowse, "Browse by Genre Number");
            toolTip.SetToolTip(btnUpdate, "Update Genre Number and Name");
            toolTip.SetToolTip(btnDelete, "Delete Genre Number");
            toolTip.SetToolTip(btnClear, "Clear all Genre fields");

            toolTip.SetToolTip(txtID, Genre.idTip);
            toolTip.SetToolTip(lblID, Genre.idTip);

            toolTip.SetToolTip(txtName, Genre.nameTip);
            toolTip.SetToolTip(lblName, Genre.nameTip);

            genreDataGridView.Width  = 43 + 2 * 100 + 17;
            genreDataGridView.Height = 23 + 8 * 22;
        }
Exemple #2
0
        private void frmMovie_Load(object sender, EventArgs e)
        {
            try
            {
                movieList = Movies.GetMovies();
                movieDataGridView.DataSource = movieList;

                List <Genre> genreList = Genres.GetGenres();
                cmbGenreID.DataSource    = genreList;
                cmbGenreID.DisplayMember = Genres.extra;
                cmbGenreID.ValueMember   = Genres.key;
                cmbGenreID.SelectedIndex = -1;
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "Failure", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }

            ToolTip toolTip = new ToolTip();

            toolTip.SetToolTip(btnAdd, "Add all Movie fields");
            toolTip.SetToolTip(btnFind, "Browse by Movie Number");
            toolTip.SetToolTip(btnUpdate, "Update all Movie fields");
            toolTip.SetToolTip(btnDelete, "Delete Movie Number");
            toolTip.SetToolTip(btnClear, "Clear all Movie fields");

            toolTip.SetToolTip(txtMovieNumber, Movie.movie_numberTip);
            toolTip.SetToolTip(lblMovieNumber, Movie.movie_numberTip);

            toolTip.SetToolTip(txtMovieTitle, Movie.movie_titleTip);
            toolTip.SetToolTip(lblMovieTitle, Movie.movie_titleTip);

            toolTip.SetToolTip(txtDescription, Movie.DescriptionTip);
            toolTip.SetToolTip(lblDescription, Movie.DescriptionTip);

            toolTip.SetToolTip(txtMovieYearMade, Movie.movie_year_madeTip);
            toolTip.SetToolTip(lblMovieYearMade, Movie.movie_year_madeTip);

            toolTip.SetToolTip(cmbGenreID, Movie.genre_idTip);
            toolTip.SetToolTip(lblGenreID, Movie.genre_idTip);

            toolTip.SetToolTip(cmbMovieRating, Movie.movie_ratingTip);
            toolTip.SetToolTip(lblMovieRating, Movie.movie_ratingTip);

            toolTip.SetToolTip(cmbMediaType, Movie.media_typeTip);
            toolTip.SetToolTip(lblMediaType, Movie.media_typeTip);

            toolTip.SetToolTip(txtMovieRetailCost, Movie.movie_retail_costTip);
            toolTip.SetToolTip(lblMovieRetailCost, Movie.movie_retail_costTip);

            toolTip.SetToolTip(txtCopiesOnHand, Movie.copies_on_handTip);
            toolTip.SetToolTip(lblCopiesOnHand, Movie.copies_on_handTip);

            toolTip.SetToolTip(txtImage, Movie.imageTip);
            toolTip.SetToolTip(lblImage, Movie.imageTip);

            toolTip.SetToolTip(txtTrailer, Movie.trailerTip);
            toolTip.SetToolTip(lblTrailer, Movie.trailerTip);

            movieDataGridView.Width  = 43 + 9 * 100 + 17;
            movieDataGridView.Height = 23 + 3 * 22 + 17;
        }