In VB6, MDI applications were possible. You'd create a form and a few Child forms and go with it.
I'm pretty sure this is still a possibility in VB2008 but where is it?
Printable View
In VB6, MDI applications were possible. You'd create a form and a few Child forms and go with it.
I'm pretty sure this is still a possibility in VB2008 but where is it?
You have to create an MDI Parent form and one or several MDI Child forms.
You can create an MDI Parent form by setting your form's "IsMdiContainer" property to True.
Alternatively, you can create a new mdi parent form complete with menubar and toolbar with default options (new/open/save, cut/copy/paste etc etc) by selecting a "MDI Parent Form" from the "Add New Item" dialog box (when you choose "Add - New Item" to add a new form).
An MDI Child form is a normal form like every other. The difference is in the way you show it.
In the MDI Parent form, you have to set the form's "MdiParent" property to your parent form.
For example, this code goes in the parent form, and the mdi child form is called "Form1":
vb.net Code:
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Form1.MdiParent = Me Form1.Show() End Sub
usefull
Hi,Quote:
Originally Posted by DroopyPawn
Here's the explaination how to create a MDI form with VB 2008 also how to create Childforms.
http://msdn2.microsoft.com/en-us/library/d4dabts7.aspx
Hope it helps,
sparrow1
I found some pretty good info in the VB2008 help last night. Thanks for responding.
OK, I'm an idiot. But, implementing MDI in VS2008 is not nearly as easy as it was in VB6.
I have the MDI form all set up as a MDI Parent. On form load, I want the login screen to show (in the MDI form). The MDI form shows, but no login screen in it.Code:Private Sub MDIParent1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim LoginForm As New LoginForm1
LoginForm.Show()
End Sub
I have been Googling and looking at a VB2005 book that I have and it still does not make sense to me.
OK, I changed the MDI Parent form load to this:
Now I get the error "A top level control cannot be added to a control"Code:Private Sub MDIParent1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
LoginForm1.Parent = Me
LoginForm1.Show()
End Sub
OK. got it. I needed to set the MDIParent not Parent