private void frmShowMovie_Load(object sender, EventArgs e) { database = new Database(this); movieController = new frmMovieController(this, gridMovie); designController = new frmDesignController(); //Displays information in the movie grid. movieController.displayGrid(); //Hide column movie id. gridMovie.Columns[0].Visible = false; //Does not allow changes to be made. gridMovie.ReadOnly = true; //Formats the design of the grid. designController.changeFont(gridMovie); }
//Form load event private void frmMain_Load(object sender, EventArgs e) { //Start instantiation movieController = new frmMovieController(this, gridMovie); designController = new frmDesignController(); employeeController = new frmEmployeeController(this, gridEmployee); customerController = new frmCustomerController(this, gridCustomer); validationController = new frmValidationController(); datePickerController = new frmDatePickerController(gridCustomer); frmLogin = new frmLogin(); overviewController = new frmOverviewController(this, cmbShowTimes); //End instantiation //Displays information in the grids. movieController.displayGrid(); employeeController.displayGrid(); customerController.displayGrid(); //Does not allow changes to be made to certain columns. gridMovie.Columns[0].ReadOnly = true; //Movie ID gridEmployee.Columns[0].ReadOnly = true; //Employee ID gridEmployee.Columns[4].ReadOnly = true; //Employee password gridCustomer.Columns[0].ReadOnly = true; //Customer ID gridCustomer.Columns[4].ReadOnly = true; //Customer password //Format the design of grids. designController.changeFont(gridMovie); //Movie grid designController.changeFont(gridEmployee); //Employee grid designController.changeFont(gridCustomer); //Customer grid //Add items to combo box movieController.addItemsToCmb(cmbMovieRating); //Add A, B and C to combo box in movie page. overviewController.addItemsToCmb(cmbShowTimes); //Add show times to the combo box in overview page. //Add date picker to the grid. datePickerController.addDatePicker(); //Puts focus on first page of tab control. tabControl.SelectedTab = tabControl.TabPages["tabPageOverview"]; }