Child Form to stay in Parent Form

G

Guest

The child form can be dragged out of the Parent form. I set the child form
to IsMdiContainer = False and the Parent Form IsMdiContainer = True. I also
coded in the Parent Form on load,
Dim f As New frmEntryForm
f.MdiParent = Me

What am I missing? The child form appears not to be attached to the parent
form.
 
M

Mike Labosh

The child form can be dragged out of the Parent form. I set the child
form
to IsMdiContainer = False and the Parent Form IsMdiContainer = True. I
also
coded in the Parent Form on load,
Dim f As New frmEntryForm
f.MdiParent = Me

What am I missing? The child form appears not to be attached to the
parent
form.

Off the top of my head, you may be showing your child form as modal. I
think (without having tried it) that the code below will allow a user to
drag the child outside the parent.

Private Sub MdiParent_MenuItem1_Click(...)
Dim f As New frmChild()
f.MdiParent = Me
f.ShowDialog()
End Sub

If think (without having tried it) that this will do what you want:

Private Sub MdiParent_MenuItem1_Click(...)
Dim f As New frmChild()
f.MdiParent = Me
f.Show()
End Sub

It is my understanding (without having tried it) that the difference is
between .Show() and .ShowDialog()

--
Peace & happy computing,

Mike Labosh, MCSD

"Mr. McKittrick, after very careful consideration, I have
come to the conclusion that this new system SUCKS."
-- General Barringer, "War Games"
 
H

Herfried K. Wagner [MVP]

Mike L said:
The child form can be dragged out of the Parent form. I set the child
form
to IsMdiContainer = False and the Parent Form IsMdiContainer = True. I
also
coded in the Parent Form on load,
Dim f As New frmEntryForm
f.MdiParent = Me

In your code you are never showing the form.

\\\
f.Show()
///
 

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