Refer parent in child form for MDI

  • Thread starter Thread starter Henry
  • Start date Start date
H

Henry

If the child form and parent form (MDI form) are in the same name
space, I can use MdiParent property to set and get the MDIParent.

But if the child form is one project, which generate a DLL, and MDI
form is in a project to generate exe output, then how can refer the
MDIparent from child form. I tried to pass parentForm as Form but the
methods defined there can not be recognized since I defined them.

Help please.
 
Henry,

In this case, you will have to define an interface in another assembly
that the MDI parent will implement. Then, in the MDI child assembly, you
can reference the same assembly that the parent does (with the interface
definition), and then cast the MDIParent property to that interface type.

Hope this helps.
 
Back
Top