Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

mdi form wont open in mdi parent

Status
Not open for further replies.

696796

Programmer
Aug 3, 2004
218
GB
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.

Code:
    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
 
Thanks for your reply...

wish it was that easy! the form that the button is located on isnt the mdi form, its a form contained in the mdi - so i did that for my form mainmenu (with all the linking buttons on). I think i need to reference the mdiCar form. hows that done?
 
Thanks, i used .MdiParent = mdiCAR.ActiveForm
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top