Solved

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

Posted on 2007-11-26
8
1,146 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
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
3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

 

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

Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
.net and XML report from SCCM 5 20
EF5: Question about Metadata Artifact Processing 4 15
in Dot net,lastest version of MVC 3 23
Search an image for an image 3 27
For those of you who don't follow the news, or just happen to live under rocks, Microsoft Research released a beta SDK (http://www.microsoft.com/en-us/download/details.aspx?id=27876) for the Xbox 360 Kinect. If you don't know what a Kinect is (http:…
This article aims to explain the working of CircularLogArchiver. This tool was designed to solve the buildup of log file in cases where systems do not support circular logging or where circular logging is not enabled
This Micro Tutorial hows how you can integrate  Mac OSX to a Windows Active Directory Domain. Apple has made it easy to allow users to bind their macs to a windows domain with relative ease. The following video show how to bind OSX Mavericks to …
Established in 1997, Technology Architects has become one of the most reputable technology solutions companies in the country. TA have been providing businesses with cost effective state-of-the-art solutions and unparalleled service that is designed…

813 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

9 Experts available now in Live!

Get 1:1 Help Now