Exemplo n.º 1
0
 private void btnAddNew_Click(object sender, EventArgs e)
 {
     frmAddVehicle addVehicleForm = new frmAddVehicle();
     addVehicleForm.FormBorderStyle = FormBorderStyle.FixedDialog;
     addVehicleForm.ControlBox = false;
     addVehicleForm.MaximizeBox = false;
     addVehicleForm.ShowDialog();
 }
        private void btnAddNew_Click(object sender, EventArgs e)
        {
            frmAddVehicle addVehicleForm = new frmAddVehicle();

            addVehicleForm.FormBorderStyle = FormBorderStyle.FixedDialog;
            addVehicleForm.ControlBox      = false;
            addVehicleForm.MaximizeBox     = false;
            DialogResult resultFromAddForm = addVehicleForm.ShowDialog();

            if (resultFromAddForm == DialogResult.OK && addVehicleForm.Tag != null)
            {
                Vehicle vehicle = (Vehicle)addVehicleForm.Tag;
                vehicles.Add(vehicle);
                DisplayVehicles();
            }
        }