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:
Here is the new() of my MDI child form:
Public Sub New(ByRef pParent As Form)
MyBase.New()
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
Try
fActiveScreen = pChildForm
fActiveScreen.Show()
fActiveScreen.BringToFront()
For Each aForm In MdiChildren
If aForm IsNot fActiveScreen Then aForm.Hide()
Next
fActiveScreen.Execute()
UpdateCaption()
Finally
hg.Dispose()
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: .
The resulting title bar buttons cannot be clicked.
Thank you for any help !
Here is your exact answer. It will solve your problem.
Add a MenuStrip to MDI form and make it invisible (Visible = false)
I got this to working by:
Try moving
Me.MaximizeBox = False
to the child form's Load event, this seemed to work in my project.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With