Changing the Form Size when WindowState is Maximized


In normal scenario when the form is Maximized it occupies the complete screen. I have required where the form is some displayed as normal form and sometimes toggled to size of a Toolbar.

I achieve this by changing the Form.Size. This works when the WindowState.Normal. However when the Form is WindowState.Maximized the size property is not reflected.

To work around this I follow these step,
- I change the Form.MaximumSize to the required size
- Change the WindowState to Normal
- Set the Form.Size property
- And reset the WindowState to Maximized

But this cause lot of flickering. Is there a better way of acheiving this result?

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!