vb.net mdi child title bar not hiding

Tuesday, July 8, 2014

I have an issue hiding the title bar of a mdi child form in maximized state within a mdi parent form in .NET.

Here's what I have at design & run time: Screenshot

Here is the new() of my MDI child form:

Public Sub New(ByRef pParent As Form)
Me.MdiParent = pParent
fParent = pParent
Me.Text = ""
Me.FormBorderStyle = Windows.Forms.FormBorderStyle.None
Me.WindowState = FormWindowState.Normal
Me.MinimizeBox = False
Me.MaximizeBox = False
Me.ControlBox = False
Me.ShowIcon = False
Me.ShowInTaskbar = False
Me.SizeGripStyle = Windows.Forms.SizeGripStyle.Hide
Me.Dock = DockStyle.Fill
End Sub

I've tried FormWindowState.Maximized and DockStyle.None instead but the result was the same.

On the parent container, to change from a child to another I use this function:

Protected Sub SetActiveScreen(ByVal pChildForm As tWizardForm)
If pChildForm Is Nothing Then Exit Sub
If fActiveScreen Is pChildForm Then Exit Sub

Dim hg As New tHourglass
fActiveScreen = pChildForm
For Each aForm In MdiChildren
If aForm IsNot fActiveScreen Then aForm.Hide()
End Try
End Sub

At design I've set the parent property IsMdiContainer = True.

Where did I go wrong or what have I missed ? Plus this kind of double buttons on the child title bar is really strange. When I click one of the maximize buttons I end up with the same result: Screenshot. The resulting title bar buttons cannot be clicked.

Thank you for any help !