public Form1() { m_car = new Car(15, 30, "Example Car"); m_car.setSpeed(30); InitializeComponent(); UpdateForm(); }
private void newCar_Click(object sender, EventArgs e) { NewCar c = new NewCar(); c.ShowDialog(); if (c.getCar() != null) { m_car = c.getCar(); UpdateForm(); } }
private void button1_Click(object sender, EventArgs e) { try { m_car = new Car(double.Parse(capTB.Text), double.Parse(mpgTB.Text), nameTB.Text); } catch (FormatException) { MessageBox.Show("Invalid Parameters. Car cannot be created."); return; } this.Close(); }
public carSettingsForm(ICarInterface c) { m_c = c; InitializeComponent(); }