Best way to Call method on MDI Parent from MDI child (vb.net 2005)

Best way to Call method on MDI Parent from MDI child (vb.net 2005)

Post by Eric » Wed, 07 Mar 2007 21:54:42


I want to call a method on the MDI parent from the child. Basically the
method will set some text (message) on a status strip and show the
appropriate icon (for the type of message).

I'd also like to put a progress bar on the MDI parent and
activate/manipulate it by the child

What's the best way to do this?

TIA

Eric
 
 
 

Best way to Call method on MDI Parent from MDI child (vb.net 2005)

Post by S2VycnkgTW » Wed, 07 Mar 2007 22:19:33

Eric,

The child form has a reference to the parent in its MDIParent property. Use
the reference to call methods, etc on the parent.

For example, assume that Form1 is the MDI parent. Here is code on the child
that calls a method named ShowMessage on the parent:

Dim f As Form1
f = Me.MdiParent
f.ShowMessage()

Kerry Moorman