// Create car private void AddCarButtonClick(object sender, EventArgs e) { DisableButtons(); listCars.Add(new Car()); CarEditForm carEditForm = new CarEditForm(listCars[listCars.Count - 1]); carEditForm.FormClosed += EnableButtons_FormClosed; carEditForm.Show(); }
private void EditCarClick(object sender, EventArgs e) { if (ListOfCars.Count != 0) { DisableButtons(); // launche the edit form. CarEditForm carEditForm = new CarEditForm(ListOfCars[listViewCar.SelectedIndices[0]]); carEditForm.FormClosed += Reload_FormClosed; carEditForm.Show(); } }