469,593 Members | 1,823 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,593 developers. It's quick & easy.

Parent child close minimize maximize

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


Nov 21 '05 #1
9 2741
Bill,

That is the controlbox = false, however you have than direct as well to add
a cancel button on your form because that is in that as well.

Cor
Nov 21 '05 #2
Bill,

That is the controlbox = false, however you have than direct as well to add
a cancel button on your form because that is in that as well.

Cor
Nov 21 '05 #3
Cor

Wahat I am trying to accompish is a Main form which the user will have to
click on the parent window to close the program. Because I don't want an
empty parent window

Bill
Nov 21 '05 #4
Cor

Wahat I am trying to accompish is a Main form which the user will have to
click on the parent window to close the program. Because I don't want an
empty parent window

Bill
Nov 21 '05 #5
Bill,

So why not do what I wrote?

Although in normal situations the closing of a child form should not close
the application.

Cor
Nov 21 '05 #6
Bill,

So why not do what I wrote?

Although in normal situations the closing of a child form should not close
the application.

Cor
Nov 21 '05 #7
Cor
I did put controlbox = false, but if the windowstate = maximized then the
maximized button is still available until it goes back to the normal window
size and then it it doesnt fit the window.

I was not wanting the child form to close the window I was wanting the
child form to stay open till the parent form is closed.

Bill
"Cor Ligthert" <no************@planet.nl> wrote in message
news:O0****************@TK2MSFTNGP11.phx.gbl...
Bill,

So why not do what I wrote?

Although in normal situations the closing of a child form should not close
the application.

Cor

Nov 21 '05 #8
Bill,

Show some code how you show the child form, maybe we can help you then now
it is to much guessing?

Cor
Nov 21 '05 #9
Hi Cor

I was able to get it to work. I rebuilt the form and did not set any of the
setting in the form design just set the items in the code and it worked for
my purpose

Thanks
Bill
Nov 21 '05 #10

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

reply views Thread by Manoj | last post: by
1 post views Thread by JDeats | last post: by
1 post views Thread by Sylvain | last post: by
4 posts views Thread by Bernie Yaeger | last post: by
reply views Thread by suresh191 | last post: by
4 posts views Thread by guiromero | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.