Do you already have direct access to the MDI child? If the child you want is
the active child then you can use
MDIMain.ActiveMdiChild
otherwise you have to enumerate the children using the MdiChildren property
to find the MDI child you want. Once you have the MDI child it will be of
type Form.
Unless you know the name of the MDI child class then you won't be able to
directly access any of its child controls by name. If you do know the class
name then it would be
( (MyClass)childForm).MyLabel = ...
or in VB.NET
DirectCast(childForm, MyClass).MyLabel = ...
If you don't know the class name for the MDI child then you are stuck
enumerating its child controls using the Controls property. For each child
control you'll need to determine if it is the label you want. Once you have
it you can do the typecast to Label to get to the actual control.
Thus there are several different methods depending on what you already know:
childForm = MDIMain.ActiveMdiChild or,
childForm = enumerate MDIMain.MdiChildren until it is found
and
DirectCast(childForm, MyMDIClass).Label = ... or,
enumerate childForm.Controls until label is found and then cast to Label
Michael Taylor - 7/3/05