コード例 #1
0
        private void editCarBtn_Click(object sender, EventArgs e)
        {
            NewCarForm newCarForm = new NewCarForm(vehicle.Car);

            if (newCarForm.ShowDialog() == DialogResult.OK)
            {
                carInfoTextBox.Text = vehicle.Car.ToString();
            }
        }
コード例 #2
0
        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();
            }
        }