Link to home
Start Free TrialLog in
Avatar of Zac123
Zac123Flag for United Kingdom of Great Britain and Northern Ireland

asked on

VB2010 - MDI Settings, child form not bound

hi all,

please can you have a look at my code.

basically when i click the button on form1 i want form2 to open but to be bound within form1 which is set as mdi = true

but when i click on the button form2 opens but it is free to travel outside of the form1, i.e. it does not apear to be bound by form1

any ideas?

 
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        Form2.MdiParent = Me

    End Sub

    Private Sub ToolStripButton1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ToolStripButton1.Click
        Form2.MdiParent = Me.MdiParent
        Form2.Show()
    End Sub


End Class

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of Mike Tomlinson
Mike Tomlinson
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Zac123

ASKER

yep you got. thanks very much.
*This fixed it because when you had "Me.MdiParent", you were assigning NOTHING as the MdiParent of Form2, since Form1 does not have an MdiParent.