Example #1
0
 public Form1()
 {
     m_car = new Car(15, 30, "Example Car");
     m_car.setSpeed(30);
     InitializeComponent();
     UpdateForm();
 }
Example #2
0
        private void newCar_Click(object sender, EventArgs e)
        {
            NewCar c = new NewCar();

            c.ShowDialog();
            if (c.getCar() != null)
            {
                m_car = c.getCar();
                UpdateForm();
            }
        }
Example #3
0
 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();
 }
Example #4
0
        public carSettingsForm(ICarInterface c)
        {
            m_c = c;

            InitializeComponent();
        }