0
votes

I am working with MDI forms and have an MDI Parent opening different MDI Children. On one particular MDI Child I want to open a normal window on the same screen as the Child, but when I move the MDI parent to a new screen, the normal window continuously opens on the primary screen.

I have tried a multitude of diffent things but can't seem to resolve it. Does anyone have any suggestions?

The form is about 4 levels down. So from the Parent, I have opened a Child, then from that Child I have opened another form inside the Parent, and from there I want to open another form that sits on top of everything at a specific location. I also want to be able to close this form using the 'Deactivate' method so it can't be a ShowDialog from as far as I can see.

Hope that all makes sense. Thanks

1
You say you've tried different things, what specifically? If you use the Show method and pass in the child form as the form owner normalWindowForm.Show(childForm), what happens? Have you tried setting the normal window bounds/location to the screen the mdi parent is on?Chase Rocker
Sorry Chase, I should've included that detail. I have tried to using frm.Owner = Me and frm.Show(Me). I'm not sure what you mean by your second comment though.Riples
what is the StartPosition (in the properties) of your normal window?Chase Rocker
I have tried using CenterParent and Manual but they both result in the same.Riples
Here's what I tested: started with a mdiParent. Moved it to a second screen. Opened a mdiChild. From that mdiChild, opened another mdiChild. From that child, opened a normal Form (set to center screen and the form owner is the mdiChild) and it opened centered on my second screen correctly. Not sure why yours doesn't work. Regarding the second part of my comment above, see this: social.msdn.microsoft.com/Forums/vstudio/en-US/…Chase Rocker

1 Answers

0
votes

You must make this form a child of the parent. You can do this by using

Form.MDIParent = Me.MDIParent
Form.Show

That should do the trick.