How to open child forms positioned within MDI parent in VB.NET?

Posted by user961627 on Stack Overflow See other posts from Stack Overflow or by user961627
Published on 2012-11-23T18:01:26Z Indexed on 2012/11/26 11:06 UTC
Read the original article Hit count: 390

Filed under:
|
|

How do we arrange child forms in a parent MDI window? I'm able to call and display a child form from a menu on the parent, but the child pops up outside the parent - I want it to actually be inside the parent. I've checked in C# and VB.Net solutions but they all say pretty much the same, i.e. try to access LayoutMDI, such as here:

http://msdn.microsoft.com/en-us/library/x9fhk181.aspx

The problem is, where do I access this? When I'm in the code of my MDI parent, Me.LayoutMdi is not recognized. In which part of the application do I put the Me.LayoutMDI code?

Edit

The Me.LayoutMDI code worked in the parent after all. I'd been trying for a while but don't know where I was going wrong.

However, the child continues to pop up out of the parent. Here's an image of how that happens. The broader form in the back is the parent, and the one with the gridview and two buttons is the new child that popped up. I want it to pop up "Docked" within the parent.

enter image description here

© Stack Overflow or respective owner

Related posts about vb.net

Related posts about vb.net-2010