Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17


From an MDI application call MDI Parent method from MDI Child - And Visa-Versa??

Posted on 2007-11-26
Medium Priority
Last Modified: 2013-12-16
I have an MDI Application:

How do I call a MDI Parent method from my MDI Child form?

And visa-versa - how do I call a MDI Child method from my MDI Parent?
Question by:VirtueTech
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
  • 5
  • 3
LVL 55

Expert Comment

by:Jaime Olivares
ID: 20352098
your mdi child has an MDIParent property.
But you have to cast it properly before using:


Author Comment

ID: 20352215
I get an Error when making this call:
   ((MainForm2 )this.MDIParent).AddCamerastoButton();

'SW24RC_DevEx.ChildMDItestForm' does not contain a definition for 'MDIParent'      

- Strange this is "Intellisense" allows me to choose the MainForm2.AddCamerastoButton method.
- ChildMDItestForm = my Child form
- MainForm2 = my Parent Form
- AddCamerastoButton() method is on my MainForm2 = MDI Parent method

LVL 55

Accepted Solution

Jaime Olivares earned 2000 total points
ID: 20352276
sorry, it should be MdiParent
Quiz: What Do These Organizations Have In Common?

Hint: Their teams ended up taking quizzes, too.


Author Closing Comment

ID: 31411045

Author Comment

ID: 20352703
How Can I do this from the Child MDI form?

Meaning how can I call a Parent method from the child?
LVL 55

Expert Comment

by:Jaime Olivares
ID: 20352926
Something like I stated earlier:


Author Comment

ID: 20353689
Yeah...I was tryng something like that, trying to use Intellisense to figure it out, but I had no luck.

Author Comment

ID: 20354207
jaime - please reffer to the following NEW question on the subject of calling a Child method from the Parent Form:

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

More often than not, we developers are confronted with a need: a need to make some kind of magic happen via code. Whether it is for a client, for the boss, or for our own personal projects, the need must be satisfied. Most of the time, the Framework…
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
This is my first video review of Microsoft Bookings, I will be doing a part two with a bit more information, but wanted to get this out to you folks.
How to fix incompatible JVM issue while installing Eclipse While installing Eclipse in windows, got one error like above and unable to proceed with the installation. This video describes how to successfully install Eclipse. How to solve incompa…

722 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