VirtueTech
asked on
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?
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?
ASKER
I get an Error when making this call:
((MainForm2 )this.MDIParent).AddCamera stoButton( );
ERROR:
'SW24RC_DevEx.ChildMDItest Form' does not contain a definition for 'MDIParent'
NOTES:
- Strange this is "Intellisense" allows me to choose the MainForm2.AddCamerastoButt on method.
- ChildMDItestForm = my Child form
- MainForm2 = my Parent Form
- AddCamerastoButton() method is on my MainForm2 = MDI Parent method
((MainForm2 )this.MDIParent).AddCamera
ERROR:
'SW24RC_DevEx.ChildMDItest
NOTES:
- Strange this is "Intellisense" allows me to choose the MainForm2.AddCamerastoButt
- ChildMDItestForm = my Child form
- MainForm2 = my Parent Form
- AddCamerastoButton() method is on my MainForm2 = MDI Parent method
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thanks.
ASKER
How Can I do this from the Child MDI form?
Meaning how can I call a Parent method from the child?
Meaning how can I call a Parent method from the child?
Something like I stated earlier:
((your_mdiparentform_class name)this. MdiParent) .somemetho d();
((your_mdiparentform_class
ASKER
Yeah...I was tryng something like that, trying to use Intellisense to figure it out, but I had no luck.
ASKER
jaime - please reffer to the following NEW question on the subject of calling a Child method from the Parent Form:
https://www.experts-exchange.com/questions/22983879/From-an-MDI-application-Call-MDI-Child-form-method-from-the-Parent-form.html
https://www.experts-exchange.com/questions/22983879/From-an-MDI-application-Call-MDI-Child-form-method-from-the-Parent-form.html
But you have to cast it properly before using:
((your_mdiform_classname)t