Solved

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

Posted on 2007-11-26
8
1,140 Views
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?
0
Comment
Question by:VirtueTech
  • 5
  • 3
8 Comments
 
LVL 55

Expert Comment

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

((your_mdiform_classname)this.MDIParent).somemethod();
0
 

Author Comment

by:VirtueTech
Comment Utility
I get an Error when making this call:
   ((MainForm2 )this.MDIParent).AddCamerastoButton();

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


NOTES:
- 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

0
 
LVL 55

Accepted Solution

by:
Jaime Olivares earned 500 total points
Comment Utility
sorry, it should be MdiParent
0
 

Author Closing Comment

by:VirtueTech
Comment Utility
Thanks.  
0
Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

 

Author Comment

by:VirtueTech
Comment Utility
How Can I do this from the Child MDI form?

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

Expert Comment

by:Jaime Olivares
Comment Utility
Something like I stated earlier:

((your_mdiparentform_classname)this.MdiParent).somemethod();
0
 

Author Comment

by:VirtueTech
Comment Utility
Yeah...I was tryng something like that, trying to use Intellisense to figure it out, but I had no luck.
0
 

Author Comment

by:VirtueTech
Comment Utility
jaime - please reffer to the following NEW question on the subject of calling a Child method from the Parent Form:
http://www.experts-exchange.com/Microsoft/Development/.NET/Visual_CSharp/Q_22983879.html
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

This document covers how to connect to SQL Server and browse its contents.  It is meant for those new to Visual Studio and/or working with Microsoft SQL Server.  It is not a guide to building SQL Server database connections in your code.  This is mo…
This article is for Object-Oriented Programming (OOP) beginners. An Interface contains declarations of events, indexers, methods and/or properties. Any class which implements the Interface should provide the concrete implementation for each Inter…
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…
This video explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.

744 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

8 Experts available now in Live!

Get 1:1 Help Now