private void Test5Difficile_Button_Click(object sender, EventArgs e) { try { TestProblemesPhysiques test = new TestProblemesPhysiques(true); TestDemonstration_Form testDemoPhysiques = new TestDemonstration_Form(test); this.Hide(); if (testDemoPhysiques.ShowDialog() == DialogResult.OK) { TestPhysique_Form testPhysiques = new TestPhysique_Form(test); if (testPhysiques.ShowDialog() == DialogResult.OK) { this.Show(); } } else { this.Show(); } } catch (Exception) { MessageBox.Show("Une erreur est survenue lors de la génération du test…", "Erreur !", MessageBoxButtons.OK, MessageBoxIcon.Error); this.Close(); } }
public TestProblemesPhysiques test; // Contient le test en cours // Constructeur du test de problèmes mathématiques (enchaînement des questions) public TestPhysique_Form(TestProblemesPhysiques testRecu) { InitializeComponent(); this.test = testRecu; }