setting the parent form

G

Guest

I use this code to open a form as a mdi child form from a mdi form menu option and it works fine

frmPolicy = New Polic
frmPolicy.MdiParent = M
frmPolicy.Show(

On the child form (frmPolicy) I have a button that I want to open a new form as a child of the mdi form

frmOrgPolicy = New OrgPolic
frmOrgPolicy.MdiParent = Me.Parent 'This is the line of code that does not work properly
frmOrgPolicy.Show(

The error that is generated is
System.InvalidCastException: Specified cast is not valid

How can I open a form as a mdi child from a mdi child and set the parent to be the parent of the first child

Thanks....
 

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