Solved

MDIParent Child relationship

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

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
Query datatable in LINQ 6 39
optimize  c# code 7 48
XML to SQL Table using c# 5 46
C# Reverse int in fast ways 6 28
Introduction                                                 Was the var keyword really only brought out to shorten your syntax? Or have the VB language guys got their way in C#? What type of variable is it? All will be revealed.   Also called…
Introduction This article series is supposed to shed some light on the use of IDisposable and objects that inherit from it. In essence, a more apt title for this article would be: using (IDisposable) {}. I’m just not sure how many people would ge…
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.

706 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

20 Experts available now in Live!

Get 1:1 Help Now