Connecting Tech Pros Worldwide Forums | Help | Site Map

Calling method in child form from MDI form?`

VM
Guest
 
Posts: n/a
#1: Nov 16 '05
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.



AlexS
Guest
 
Posts: n/a
#2: Nov 16 '05

re: Calling method in child form from MDI form?`


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

"VM" <vonchi_m@yahoo.com> wrote in message
news:OG%23glGPREHA.3580@TK2MSFTNGP11.phx.gbl...[color=blue]
> How can I call a method in a child Form from within the parent MDI form?[/color]
The[color=blue]
> 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[/color]
that[color=blue]
> draws the form while the other calls it from outside.
>
> Thanks.
>
>[/color]


Yasumitsu Tanaka
Guest
 
Posts: n/a
#3: Nov 16 '05

re: Calling method in child form from MDI form?`


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

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

"VM" <vonchi_m@yahoo.com> wrote in message
news:OG%23glGPREHA.3580@TK2MSFTNGP11.phx.gbl...[color=blue]
> How can I call a method in a child Form from within the parent MDI form?[/color]
The[color=blue]
> 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[/color]
that[color=blue]
> draws the form while the other calls it from outside.
>
> Thanks.
>
>[/color]

Closed Thread