private void editCarBtn_Click(object sender, EventArgs e) { NewCarForm newCarForm = new NewCarForm(vehicle.Car); if (newCarForm.ShowDialog() == DialogResult.OK) { carInfoTextBox.Text = vehicle.Car.ToString(); } }
private void addCarBtn_Click(object sender, EventArgs e) { Car car = new Car(); NewCarForm newCarForm = new NewCarForm(car); if (newCarForm.ShowDialog() == DialogResult.OK) { vehicle.Car = car; carInfoTextBox.Text = car.ToString(); } }