Home All Groups Group Topic Archive Search About

Referencing a MDI Parent form from a Child

Author
20 Jul 2006 5:24 PM
Matt
Ok here is my problem:

I have a MDI parent form called "Main" that I declare in a public
module when I start up my program.  This form holds the drop down menu
that allows my users to access all of the child forms.

Now lets say I have a child form called "Child." When I open up that
child form from "Main" I shut off the menu on "Main" so that the user
cannot open up any other forms while they are in the "Child" form.

My problem is right before I close "Child" form and return to "Main" I
want to turn this menu back on.  I can reference my global form "Main"
in the child form but it doesn't seem to work when I try to enable the
menu.

This is a problem that will cause me grief later on when I try to use
other things that I have painted on the "Main" form from child forms.

Can someone please tell me a way to reference things on "Main" from
"Child"

Thanks
Matt

Author
20 Jul 2006 6:47 PM
Kerry Moorman
Matt,

The things you want to reference on the "Main" form need to be public.

You should be able to reference the MDI parent form from the child form like
this:

Me.MDIParent

Kerry Moorman


Show quoteHide quote
"Matt" wrote:

> Ok here is my problem:
>
> I have a MDI parent form called "Main" that I declare in a public
> module when I start up my program.  This form holds the drop down menu
> that allows my users to access all of the child forms.
>
> Now lets say I have a child form called "Child." When I open up that
> child form from "Main" I shut off the menu on "Main" so that the user
> cannot open up any other forms while they are in the "Child" form.
>
> My problem is right before I close "Child" form and return to "Main" I
> want to turn this menu back on.  I can reference my global form "Main"
> in the child form but it doesn't seem to work when I try to enable the
> menu.
>
> This is a problem that will cause me grief later on when I try to use
> other things that I have painted on the "Main" form from child forms.
>
> Can someone please tell me a way to reference things on "Main" from
> "Child"
>
> Thanks
> Matt
>
>
Author
20 Jul 2006 6:54 PM
Cor Ligthert [MVP]
Matt,

Every midi parent holds an array of its midi forms.
You have to find this by looping through the array, than you can reference
to that midi child using the founded collectionitem.

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfsystemwindowsformsformclassmdichildrentopic.asp

I hope this helps,

Cor

Show quoteHide quote
"Matt" <Kru***@gmail.com> schreef in bericht
news:1153416276.319392.315440@i42g2000cwa.googlegroups.com...
> Ok here is my problem:
>
> I have a MDI parent form called "Main" that I declare in a public
> module when I start up my program.  This form holds the drop down menu
> that allows my users to access all of the child forms.
>
> Now lets say I have a child form called "Child." When I open up that
> child form from "Main" I shut off the menu on "Main" so that the user
> cannot open up any other forms while they are in the "Child" form.
>
> My problem is right before I close "Child" form and return to "Main" I
> want to turn this menu back on.  I can reference my global form "Main"
> in the child form but it doesn't seem to work when I try to enable the
> menu.
>
> This is a problem that will cause me grief later on when I try to use
> other things that I have painted on the "Main" form from child forms.
>
> Can someone please tell me a way to reference things on "Main" from
> "Child"
>
> Thanks
> Matt
>