private void fin() { if (errors.Count != 0) { string text = ""; foreach (string s in errors) { text += s + "\n"; } MessageBox.Show(text, "Liste des erreurs", MessageBoxButtons.OK); } DialogResult dialogResult = MessageBox.Show("Voulez recommencez ?", "Fin du process", MessageBoxButtons.YesNo); if (dialogResult == DialogResult.Yes) { Photos_Videos f = new Photos_Videos(photos); f.MdiParent = this.MdiParent; f.Show(); Close(); } else if (dialogResult == DialogResult.No) { Close(); } }
private void startForm(int p) { Form instance = null; // Looking for MyForm among all opened forms foreach (Form form in Application.OpenForms) { switch (p) { case 0: if (form is Dossiers) { instance = form; break; } break; case 1: if (form is Musiques) { instance = form; break; } break; case 2: case 3: if (form is Photos_Videos) { instance = form; break; } break; } } if (Object.ReferenceEquals(null, instance)) { switch (p) { case 0: instance = new Dossiers(); instance.MdiParent = this; instance.Show(); break; case 1: instance = new Musiques(); instance.MdiParent = this; instance.Show(); instance.WindowState = FormWindowState.Maximized; break; case 2: instance = new Photos_Videos(true); instance.MdiParent = this; instance.Show(); instance.WindowState = FormWindowState.Maximized; break; case 3: instance = new Photos_Videos(false); instance.MdiParent = this; instance.Show(); instance.WindowState = FormWindowState.Maximized; break; } } else { instance.BringToFront(); } }
private void fin() { if (errors.Count != 0) { string text = ""; foreach (string s in errors) text += s + "\n"; MessageBox.Show(text, "Liste des erreurs", MessageBoxButtons.OK); } DialogResult dialogResult = MessageBox.Show("Voulez recommencez ?", "Fin du process", MessageBoxButtons.YesNo); if (dialogResult == DialogResult.Yes) { Photos_Videos f = new Photos_Videos(photos); f.MdiParent = this.MdiParent; f.Show(); Close(); } else if (dialogResult == DialogResult.No) { Close(); } }
private void startForm(int p) { Form instance = null; // Looking for MyForm among all opened forms foreach (Form form in Application.OpenForms) switch (p) { case 0: if (form is Dossiers) { instance = form; break; } break; case 1: if (form is Musiques) { instance = form; break; } break; case 2: case 3: if (form is Photos_Videos) { instance = form; break; } break; } if (Object.ReferenceEquals(null, instance)) { switch (p) { case 0: instance = new Dossiers(); instance.MdiParent = this; instance.Show(); break; case 1: instance = new Musiques(); instance.MdiParent = this; instance.Show(); instance.WindowState = FormWindowState.Maximized; break; case 2: instance = new Photos_Videos(true); instance.MdiParent = this; instance.Show(); instance.WindowState = FormWindowState.Maximized; break; case 3: instance = new Photos_Videos(false); instance.MdiParent = this; instance.Show(); instance.WindowState = FormWindowState.Maximized; break; } } else { instance.BringToFront(); } }