Solved

MDIParent Child relationship

Posted on 2004-04-07
2
1,072 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Extention Methods in C# 3.0 by Ivo Stoykov C# 3.0 offers extension methods. They allow extending existing classes without changing the class's source code or relying on inheritance. These are static methods invoked as instance method. This…
Summary: Persistence is the capability of an application to store the state of objects and recover it when necessary. This article compares the two common types of serialization in aspects of data access, readability, and runtime cost. A ready-to…
This video shows how to use Hyena, from SystemTools Software, to update 100 user accounts from an external text file. View in 1080p for best video quality.

734 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