Link to home
Start Free TrialLog in
Avatar of huji
hujiFlag for United States of America

asked on

MDI Child always maximized

I want an MDI child to appear as maximised. Here is what I do:

    Private Sub frmList_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        Me.WindowState = FormWindowState.Maximized
    End Sub

Now, I want to prevent the user from restoring it to normal size. How can I do that?
ASKER CERTIFIED SOLUTION
Avatar of newyuppie
newyuppie
Flag of Ecuador image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
or set the form border to Fixed and user will not be able to resize it. you could also dissapear the minimize and restore buttons via the properties in the design time of the form
Avatar of huji

ASKER

>> you could also dissapear the minimize and restore buttons via the properties in the design time of the form
This makes the maximize button of  a normal sized form to disappear, but doesn't make the "restore" button of a maximized for to disappear!!

>> set the form border to Fixed
That didn't herlp either!!

>>try handling the Form Resize event and put the same code
Me.WindowState = FormWindowState.Maximized

I need to maximize the form in the beginning. I do it in the Load even handler. Using the same sub to handle Resize made the Load not to function properly about maximizing the form. However, setting up a different handler made the trick.

Thanks
Huji