Wrong Form is focused after closing form in firemonkey

  

When showing and closing Forms in firemonkey, the application cannot remember wich form was the last activated form, and activates the wrong form.

How can I activate the last active form instead of an arbitrary form chosen by the application?

To replicate : Create 3 forms and open each one in succession from previous form.

I a mainform and 2 ChildForms, the second form is parent to the third form.

I open the first childForm from my MainForm.

var
tmpForm2:TForm2;
begin
tmpForm2:=TForm2.Create(self);
tmpForm2.Show;
end;

In this Form there is a button that shows second childform

var
form3:Tform3;
begin
form3:=TForm3.Create(nil);
form3.Show;
end;

When I open the second ChildForm and close it, the Mainform is activated. Instead of the first ChildForm

Now I repeat the process but when closing the second ChildForm, the first one is actived, as one would expect.

Next time the Mainform is again activated, so the order keeps chainging, instead of the real last active form.

Comments are closed.