I'm trying to create a new app in MDI but I cant seem to get the children correct. The farthest I got was setting the IsMDIContainer to True. How would I proceed? Also, I have my own menu bar on the left side of the window with buttons that should lead to the children. My menu bar keeps the focus when I try to open other windows. Please advise.
MDI Form VB.Net in Visual Studio 2005
Collapse
X
-
Tags: None
-
You set the parent's IsMDIContainer to true, not the child's.
Set the child's MDIParent = to an instance of the mdi parent form.
What I usually do is modify the constructor to take a parameter of the type that your mdi parent is. For example, if you named the parent's class myMdiParent, then the child's constructor should look like this:
And you can instantiate this form like thisCode:'in myMdiChild Public Sub New(myMdiParent parent) { Me.MDIParent = parent }
Just replace myMdiChild and myMdiParent with the proper class names.Code:'somewhere in myMdiParent Dim child As New myMdiChild(me) child.Show()
I can't remember off the top of my head how to merge menu bars, but I'll dig up one of my old apps and find it tomorrow.
Hope that helps
I haven't tested this code (I usually work in C#)
Comment