Solved

MDIParent Child relationship

Posted on 2004-04-07
2
1,070 Views
Last Modified: 2012-05-04
Hello Expert, I have a form and my frmMainMenu is the mdiParent, and on the frmMainMenu when i select to open ProjectInfo I make that the child
                                                this.SetMnuProjectInfo(false);
                  ProjectInfo.frmProjectInfo frmProjectInfoGUI = new ProjectInfo.frmProjectInfo();
                  frmProjectInfoGUI.MdiParent = this;
                  frmProjectInfoGUI.Show();
                  this.Focus();
My problem is when i am on my frmProjectInfo and i want to open frmContactInfo from inside that form how can i get it to open inside the mdiParent this is my code to open the other form
                                                              ContactInfo.frmContactInfo frmContactInfoGUI = new ContactInfo.frmContactInfo();
                        Genesis.frmMainMenu afrmMainMenu = new Genesis.frmMainMenu();
                  
                        frmContactInfoGUI.ShowDialog(this) ;
                        FillComboBoxes();
                        if(aProjectInfoPD.GetProjectID() != 0)
                        {
                              modes(true);
                              PopulateContact();
                              LoadInformation();
                        }
the reason i use a showDialog is cause once that form is closed i need to repopulate my comboboxes with the contact that was added any ideas on how i could do this?
Thanks
0
Comment
Question by:jvoros1
2 Comments
 
LVL 37

Accepted Solution

by:
gregoryyoung earned 500 total points
ID: 10781082
you could also handle the event of the form frmContactInfoGUI with a function that repopulated the comboboxes ...
                  private void OnContactChange(object sender, System.EventArgs e) {
                 FillComboBoxes();
                           if(aProjectInfoPD.GetProjectID() != 0)
                           {
                                 modes(true);
                                 PopulateContact();
                                 LoadInformation();
                           }
        }


                   //when you go to show
                   //instantiate set parent to real parent
                   frm.Closed += new EventHandler(this.OnContactChange) ;
                   frmContactInfoGUI.Show() ;


this will allow it to be shown as a MDI form and trap when the MDI form is closed.
0
 

Author Comment

by:jvoros1
ID: 10813762
That worked great thank you sooo much
0

Featured Post

Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Entity Framework is a powerful tool to help you interact with the DataBase but still doesn't help much when we have a Stored Procedure that returns more than one resultset. The solution takes some of out-of-the-box thinking; read on!
Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

860 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question