private void FrmMain_Shown(object sender, EventArgs e) { switch (_dial.ShowDialog(this)) { case DialogResult.OK: MessageBox.Show("Bienvenue " + MonApplication.UtilisateurConnecte.Nom); break; case DialogResult.Cancel: Close(); break; } }
private void FrmMain_Shown(object sender, EventArgs e) { DialConnexion DialogueModal = new DialConnexion(); // DialogResult resultat = DialogueModal.ShowDialog(); DialogResult resultat = DialogResult.OK; switch (resultat) { case DialogResult.None: DialogueModal.ShowDialog(); break; case DialogResult.OK: gestionToolStripMenuItem.Enabled = true; break; case DialogResult.Cancel: DialogueModal.Close(); Close(); break; } }