10-15 a day! I'd spent my whole day in the bathroom! :-0 2-3 is enough for me.
dmccabe2
Posts
-
How many... -
MdiParent QuestionDon't know if this is the best way but... In your MDI Main create a method which passes a temporary Form as a parameter then iterate through all open forms to return the index of the form: int formIndex = -1; int i = 0; foreach (Form cf in this.MDIChildren) { // compare the Form you passed with all open Forms if (passedForm.GetType() == cf.GetType()) { formIndex = i; } i++; } Replace the code in the if statement of the dialogresult to: ThirdForm tempForm = new ThirdForm(); int frmIndex = IndexOfForm(tempForm); tempForm.Dispose(); // The form is not open if(frmIndex == -1) { ThirdForm ThirdFormGUI = new ThirdForm(); ThirdFormGUI.MdiParent = this; ThirdFormGUI.Show(); } // The form is already open else { this.MdiChildren[frmIndex].BringToFront(); }
-
MdiParent QuestionIs this what you're looking for? in MDI main form: private void menuItem1_Click(object sender, System.EventArgs e) { DialogForm aDialogFormGUI = new DialogForm(); if (aDialogFormGUI.ShowDialog()== DialogResult.OK) { ThirdForm aThirdFormGUI = new ThirdForm(); aThirdFormGUI.MdiParent = this; aThirdFormGUI.Show(); } } On the Dialog form in the Close event or Click; DialogResult = DialogResult.OK; Hope this helps.