
Disallowing maximize button on MDI child form
This one is quite simple... I'm surprised MS Tech Support didn't know.
Turn the ControlBox setting for the child form to false and set the
WindowState property to 2 - Maxamize (which you said you do... I also
set the child caption to nothing). I've done this several times and
works just fine.
Quote:
>Have you ever tried setting the WindowsState property on an MDI child form
>to 2 (Maximized) with the MaxButton property set to false? If you have you
>will know it does not work!! According to a Microsoft's VB Escalation Team
>member this is "by design for an MDIChild From" although VB5's definition
>of MaxButton is to indicate whether a form has/does not have a MaxButton...
>not consistent if you ask me.
>Enough background... has anyone found a workaround for this? I need a
>Child Form that is always maximized (Windows State = 2) and cannot be
>altered by the user outside of closing the form. I've tried using the
>GetWindowLong and SetWindowLong Windows API calls to disable the
>WS_MAXMIMIZE bit in the GWL_STYLE parameter which works fine for a Parent
>form, but does not work for a child form.
>Microsoft's solution was to set the Width & Height to "some Large values...
>so that it looks Maximized". That's not acceptable either since the form
>is still in a Normal state with a horizontal scroll bar at the bottom (yuk)
>that the user must use to find the close button, stuck somewhere out in
>never never land.
>Thank you very much.
Chris Nielsen - EDS