use of mdi

Banks
07-04-2006, 04:34 AM
hi,

i am trying to develop an mdi style system so that one parent form holds all child forms. I think i have set up the mdi form correctly, but i cant get some forms to open inside the mdi.

for instance i have a main menu form that does open in the mdi, which has buttons on it which i want to link to other pages. with the code below i have placed on the buttons, the form opens a new window.


Private Sub btnRaiseCar_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnRaiseCar.Click
Dim frmCar As New frmCar
With frmCar
.Text = "Child " & Me.MdiChildren.GetLength(0)
.WindowState = FormWindowState.Normal
.ControlBox = True
.Show()

End With
End Sub


i think i may be missing some code assigning the mdiarent but am unsure - the mdi parent form is called mdiCAR.

Thanks, alex

JNewt
07-04-2006, 08:14 AM
The child form needs to have its MdiParent property set to the MDI form -- so you should add one more thing to that With block: .MdiParent = Me

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum