Talking with an open form

  • Thread starter Thread starter Daniel Diehl
  • Start date Start date
D

Daniel Diehl

Hi there,
just a short question. How can I get access to a open form (is also
the MDI parent)? <FORMNAME>.<FUNCTION> does not work but I have to
call a method in the mainForm of the Application to start a
taskbar-Notification e.g.

Thanks for an short answer!

Daniel
 
Daniel Diehl said:
How can I get access to a open form (is also the
MDI parent)?
<FORMNAME>.<FUNCTION> does not work

'this.MdiParent' retrieves the parent of an MDI child form.

You will have to cast it to the type of the parent form. For example, if
your main form's class is called frmMain, you might write:

frmMain frm = (frmMain) this.MdiParent;
frm.Text = "this will change the caption";

P.
 
Back
Top