public AdminForm(FrontForm front) { try { Locations = SaveLoad.LoadAirports(); Fleet = SaveLoad.LoadFleet(); Flights = SaveLoad.LoadFlights(); AllAirports = SaveLoad.LoadAllAirports(); } catch (FileNotFoundException ex) { MessageBox.Show(ex.Message); } Front = front; InitializeComponent(); //the first panel to be displayed FlightPanel flightPanel = new FlightPanel(Flights, Fleet, Locations); //displaying method with inputed panel AddControls(flightPanel); btnFlight.BackColor = SystemColors.Control; btnFlight.Enabled = false; }
private void btnFlight_Click_1(object sender, EventArgs e) { FlightPanel flightPanel = new FlightPanel(Flights, Fleet, Locations); AddControls(flightPanel); btnFlight.BackColor = SystemColors.Control; btnAirport.BackColor = Color.SteelBlue; btnFleet.BackColor = Color.SteelBlue; btnFlight.Enabled = false; btnFleet.Enabled = true; btnAirport.Enabled = true; }