By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,949 Members | 884 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,949 IT Pros & Developers. It's quick & easy.

setting the parent form

P: n/a
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....
Nov 22 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
use the me.parentform property
Nov 22 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.