MDI child forms to be closed but not resized

Carrie
03-29-2003, 10:05 AM
I need to have the mdichild forms in my app to be opened as maximised in the MDImainform and I can stop the user minimising by setting the property to false but can't stop the resizing button appearing. If I set the form type to non resizable it just doesn't show at all. I need all my MDIchildren to fill the main window when they are opened, and not be resizable.

Flyguy
03-29-2003, 03:43 PM
Set the borderstyle to none and the windowstate to maximized

Carrie
03-30-2003, 11:15 AM
Help! When I do that it disappears altogether.

Thinker
03-30-2003, 11:25 AM
The way I do it is set the BorderStyle to 3 fixed dialog. I leave the min
button on but you could turn that off. Set the size of the form to match
the scaleheight and scalewidth of the mdiform and it will be close to
maximized.

Carrie
03-30-2003, 12:26 PM
If I try either of those my child form disappears - I must have some other property incorrect - it shows alright if my child form is resizable but if I change this to fixed dialog or none it vanishes.

Thinker
03-30-2003, 12:29 PM
Did you set it to be a MDIChild form? Could you do a small example
project, zip it up and attach it here?

Carrie
03-30-2003, 01:08 PM
Yes, here it is with just one form that disappears when I change borderstyle

Thinker
03-30-2003, 01:54 PM
First thing you have to do is set frmUtilities WindowState back to
0 - Normal. A fixed size window can't have that as Maximized. Then in
frmUtilities add the Resize event sub...

Private Sub Form_Resize()
Static inResize As Boolean

If Not inResize Then
inResize = True
Me.Move 0, 0, MDIMainWin.ScaleWidth, MDIMainWin.ScaleHeight
inResize = False
End If
End Sub
Now this won't resize the form to fill the mdi one if it gets resized so you
will have to either stop it (in its resize event) or keep resizing the child
form each time the mdi form gets resized. Something like...

Private Sub MDIForm_Resize()
frmUtilities.Move 0, 0, Me.ScaleWidth, Me.ScaleHeight
End Sub

Now this just isn't the same as having the form maximized but I can't be
sure what effect you are after.

Carrie
03-30-2003, 01:58 PM
Thanks a lot - all I need is to have my child forms maximised so that the user only sees one at a time, but can use the menus etc. from the MDI form at any time.

dexmix
03-30-2003, 10:48 PM
you could set the controlbox property to false on the MDI Child.
then you can use WindowState=Maximized

Carrie
03-31-2003, 01:34 AM
Thanks a lot - all I needed to do was set controlbox=false and leave borderstyle= resizable and I get what I wanted.

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum