0
votes

I have two forms : 1 MDI form and 1 Child form

Whene I show (Form.show()) my Child Form on my MDI Form, the Child Form is not visible. What is the problem ?

My code is :

'My MDI Form code
Private Sub GestionnaireDesTâchesToolStripMenuItem_Click(sender As System.Object, e As System.EventArgs) Handles GestionnaireDesTâchesToolStripMenuItem.Click
    TaskMGR.Show()
End Sub

'My Child form code
Private Sub TaskMGR_Load(sender As System.Object, e As System.EventArgs) Handles MyBase.Load
    Me.MdiParent = Form1
    Me.Visible = True
End Sub
1
Code like yours works perfectly fine for me. That said, there are a couple of oddities. Firstly, you generally set the MdiParent in the parent form before calling Show. Doing it in the child is bad practice. Also, setting Visible to True at the end of the Load event handler is pointless as that's what happens when that event handler completes anyway. Make those changes and try again. If it still doesn't, try a new test project with the bare minimum of functionality to test that specifically. You should always do that before posting here anyway. – jmcilhinney

1 Answers

0
votes

Did you specify Form1 to be an MDIContainer?

If so, did you set Form2s location to be outside the visible range?