Jump to content
Sign in to follow this  
Attila Kovacs

Minimizing and restoring a maximized window

Recommended Posts

I have a form, designed size let's say 640x680. Everything dynamic, every control is inside a TGridPanel, aligned.

Designed formstate wsMaximized, one button can minimize the app with Application.Minimize or ShowWindow(Handle, SW_MINIMIZE).

Everything fine. For the fist sight. But:

On startup, the form will be rendered in 640x680 then resized to fullscreen and re-rendered.

On minimize, form will silently resized to 640x680, rendered while it's became invisible, and on restore resized again to fullscreen and re-rendered again.

How should I skip the unnecessary resizings/renderings/align calculations?

Edited by Attila Kovacs

Share this post


Link to post

Hm, looks like the solution is easier than I thought.

Instead of setting the formstate to wsMaximized, if I'm setting the form's width and height to the Screen's width and height in the OnCreate event,

the problems are gone. 

 

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×