B
Bill
Hi
I have a parent child forms. I want the close, maximize, and minimize
buttons to be removed.
One the child form I have set the maximize and minimize buttons to false. I
have the child form mamiximze in the parent form. So then the maximized
button is still active. But I want the child form to fill the parent form
without the ability to close minimize or maximize the form like a default
page.
The buttons are removed when the child form is not maximized.
Thanks in advance
Bill
This is the parent form Load
Private Sub frmContainC_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
Dim objChild As frmMain = New frmMain()
objChild.ControlBox = False
objChild.MdiParent = Me
objChild.Show()
End Sub
on the child form
Private Sub frmMain_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
Me.ControlBox = False
End Sub
Protected Overrides ReadOnly Property CreateParams() As
System.Windows.Forms.CreateParams
Get
Dim cp As CreateParams = MyBase.CreateParams
Const CS_DBLCLKS As Integer = &H8
Const CS_NOCLOSE As Integer = &H200
cp.ClassStyle = CS_DBLCLKS Or CS_NOCLOSE
Return cp
End Get
End Property
I have a parent child forms. I want the close, maximize, and minimize
buttons to be removed.
One the child form I have set the maximize and minimize buttons to false. I
have the child form mamiximze in the parent form. So then the maximized
button is still active. But I want the child form to fill the parent form
without the ability to close minimize or maximize the form like a default
page.
The buttons are removed when the child form is not maximized.
Thanks in advance
Bill
This is the parent form Load
Private Sub frmContainC_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
Dim objChild As frmMain = New frmMain()
objChild.ControlBox = False
objChild.MdiParent = Me
objChild.Show()
End Sub
on the child form
Private Sub frmMain_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
Me.ControlBox = False
End Sub
Protected Overrides ReadOnly Property CreateParams() As
System.Windows.Forms.CreateParams
Get
Dim cp As CreateParams = MyBase.CreateParams
Const CS_DBLCLKS As Integer = &H8
Const CS_NOCLOSE As Integer = &H200
cp.ClassStyle = CS_DBLCLKS Or CS_NOCLOSE
Return cp
End Get
End Property