Refer parent in child form for MDI

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.
 
N

Nicholas Paldino [.NET/C# MVP]

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top