Solved

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

Posted on 2007-11-26
8
1,151 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
[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
  • 5
  • 3
8 Comments
 
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:

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

Author Comment

by:VirtueTech
ID: 20352215
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
ID: 20352276
sorry, it should be MdiParent
0
Salesforce Has Never Been Easier

Improve and reinforce salesforce training & adoption using WalkMe's digital adoption platform. Start saving on costly employee training by creating fast intuitive Walk-Thrus for Salesforce. Claim your Free Account Now

 

Author Closing Comment

by:VirtueTech
ID: 31411045
Thanks.  
0
 

Author Comment

by:VirtueTech
ID: 20352703
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
ID: 20352926
Something like I stated earlier:

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

Author Comment

by:VirtueTech
ID: 20353689
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
ID: 20354207
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

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

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

A long time ago (May 2011), I have written an article showing you how to create a DLL using Visual Studio 2005 to be hosted in SQL Server 2005. That was valid at that time and it is still valid if you are still using these versions. You can still re…
Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
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.

759 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