VirtueTech
asked on
From an MDI application - Call MDI Child form method from the Parent form?
Hello,
"jaime_olivares" helped me on this question to call an MDI Parent Form method from a child form:
https://www.experts-exchange.com/questions/22983140/From-an-MDI-application-call-MDI-Parent-method-from-MDI-Child-And-Visa-Versa.html
Now I need to call a Child Forms method from its Parent. Anyone?
Here is my solution from "jaime_olivares" in the other question:
((MainForm2 )this.MDIParent).AddCamera stoButton( );
NOTES:
- ChildMDItestForm = my Child form
- MainForm2 = my Parent Form
- AddCamerastoButton() method is on my MainForm2 = MDI Parent method
"jaime_olivares" helped me on this question to call an MDI Parent Form method from a child form:
https://www.experts-exchange.com/questions/22983140/From-an-MDI-application-call-MDI-Parent-method-from-MDI-Child-And-Visa-Versa.html
Now I need to call a Child Forms method from its Parent. Anyone?
Here is my solution from "jaime_olivares" in the other question:
((MainForm2 )this.MDIParent).AddCamera
NOTES:
- ChildMDItestForm = my Child form
- MainForm2 = my Parent Form
- AddCamerastoButton() method is on my MainForm2 = MDI Parent method
in a mdi application you can have many child forms, not just one, so, how do you know which to call?
ASKER
I tried this but I get an error:
((ChildMDItestForm)this.Md iChildren) .upgradeLa youtbyXML( 1);
ERROR:
Cannot convert type 'System.Windows.Forms.Form []' to 'SW24RC_DevEx.ChildMDItest Form'
((ChildMDItestForm)this.Md
ERROR:
Cannot convert type 'System.Windows.Forms.Form
ASKER
Similar to your comment jaime...the error states that I need to know which child form, thus the array.
I'm using the MDI Manager from DevExpress, and where I need to call the Child form method is always on the selected/active child form.
I'm using the MDI Manager from DevExpress, and where I need to call the Child form method is always on the selected/active child form.
MdiChildren is a collection. You have to pick one.
ASKER
how?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thank you Jaime! You're full of information and have been extremely helpful!