Calling method in child form from MDI form?`

  • Thread starter Thread starter VM
  • Start date Start date
V

VM

How can I call a method in a child Form from within the parent MDI form? The
child form has a Save method but I'd also like to give the user the
opportunity to "save" from the MDI form also. They'd both run the same
method; the only difference is that one calls it from within the class that
draws the form while the other calls it from outside.

Thanks.
 
Hi, VM

you have to keep reference to active child in main form. Then event handler
for main form command could find out, which child save method to call.

HTH
Alex
 
this is a code to close child forms from the parent MDI form.

foreach( Form f in this.MdiChildren )
{
f.Close();
}
 
Back
Top