Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

MDI Forms - Opening child

Status
Not open for further replies.

RTorrance

Programmer
Apr 12, 2002
64
CA
Hello,
I am having a problem with opening a second child form in my MDI Parent. I have 3 forms, one being a parent and 2 children. I open the first child from a menu and then from this form i want to open the second child and close the first child. I have tried numerous ways and looked through this forum and cannot get it to work. I can get it to close the first form, but can't get the second one to show up at all. Any help would be appreciated. Thanks.
Rachael
 
Could you please post what you did to make this work, I am having the same problem.

Thanks!
 
To show a form on MDI parent try this,

form1.DefInstance.Show()

or this...

Dim Form1 as new Form1
Form1.Show()

hope it works

 
Thanks for the reply. Your answer works when opening the child form from an MDI parent. The problem comes in when trying to open a child form from another child form. As was stated in the original message of this thread:

"I have 3 forms, one being a parent and 2 children. I open the first child from a menu and then from this form i want to open the second child and close the first child. I have tried numerous ways and looked through this forum and cannot get it to work. I can get it to close the first form, but can't get the second one to show up at all."

This is exactly the problem I am having and I don't understand why the child form will not show.

Any further clarification will be greatly appreciated.
 
The following seems to work:

Dim MyMDIParent = Me.MdiParent.FindForm
Dim ChildForm as New frmChild

ChildForm.MdiParent = MyMDIParent
ChildForm.Show()

Still not quite sure why it works, but it does and for that I am grateful.

Thanks for trying to help.

deed59

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top