Solved

MDIParent Child relationship

Posted on 2004-04-07
2
1,069 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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

This article describes a simple method to resize a control at runtime.  It includes ready-to-use source code and a complete sample demonstration application.  We'll also talk about C# Extension Methods. Introduction In one of my applications…
The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
This Micro Tutorial will give you a basic overview how to record your screen with Microsoft Expression Encoder. This program is still free and open for the public to download. This will be demonstrated using Microsoft Expression Encoder 4.
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, just open a new email message. In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…

813 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now