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

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?
VirtueTechAsked:
Who is Participating?
 
Jaime OlivaresConnect With a Mentor Software ArchitectCommented:
sorry, it should be MdiParent
0
 
Jaime OlivaresSoftware ArchitectCommented:
your mdi child has an MDIParent property.
But you have to cast it properly before using:

((your_mdiform_classname)this.MDIParent).somemethod();
0
 
VirtueTechAuthor Commented:
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
Cloud Class® Course: C++ 11 Fundamentals

This course will introduce you to C++ 11 and teach you about syntax fundamentals.

 
VirtueTechAuthor Commented:
Thanks.  
0
 
VirtueTechAuthor Commented:
How Can I do this from the Child MDI form?

Meaning how can I call a Parent method from the child?
0
 
Jaime OlivaresSoftware ArchitectCommented:
Something like I stated earlier:

((your_mdiparentform_classname)this.MdiParent).somemethod();
0
 
VirtueTechAuthor Commented:
Yeah...I was tryng something like that, trying to use Intellisense to figure it out, but I had no luck.
0
 
VirtueTechAuthor Commented:
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
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.