Jump to content
Nicolò Blunda

FMX Form On maximize event

Recommended Posts

Hello.

There is a way to detect Form OnMiximize event (to disable SizeGrip in a Status Bar)?

I find a lot of pages for OnMiximize detection via TApplication object, but only for VCL developpment...
 

Edited by Nicolò Blunda

Share this post


Link to post

Put this in Resize event :

 

    TThread.ForceQueue(TThread.CurrentThread,
        procedure
        begin

            if ord(self.WindowState) = 2 then
                showmessage('wsMaximized ');
        end);

 

Runs fine under Windows, not tested on MacOs or Linux.

 

Hope this helps

Share this post


Link to post

Thank you very much.
Your code works on Windows but only to show message (like that your have insert).
But if you want, for example, to show or hide control like this

TThread.ForceQueue(TThread.CurrentThread,
        procedure
        begin
            if ord(self.WindowState) = 2 then
                labe1.visible:= false
            else
                labe1.visible:= true;
         end);

code works only utlil maximization oparation is performed.
When form is reset to original dimensions, code don't works.
Regards.

Edited by Nicolò Blunda

Share this post


Link to post

Hello,

 

Runs fine for me on a very new project...

 

procedure TForm1.FormResize(Sender: TObject);
begin
    TThread.ForceQueue(TThread.CurrentThread,
            procedure
        begin

            if ord(self.WindowState) = 2 then
                Label1.visible := false
            else
                Label1.visible := true;

        end);
end;

end.

 

 

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

×