2
votes

I just installed the new Delphi Sydney 2 (10.4.2) and I have found something weird:

  • Create a new vcl app.
  • Add a new form.
  • Set the second form Visible to True (so we can see it). Don't change any other project settings/form properties.
  • Run the app.

The second form will always be on top of the main form.
Setting the FormStyle to fsNormal at run time will not fix the behavior.

Can anyone confirm this behavior?

1
Yes, this is the default behaviour. I'd say it is well known. Also: if this was indeed a bug, it wouldn't be a compiler bug. It would be a bug in the RTL. Related: stackoverflow.com/questions/4241308/…Andreas Rejbrand
@AndreasRejbrand - Looks like I haven't started a new project from IDE, in years. ThanksZ80

1 Answers

1
votes

Solved. I looked back in my existing projects. They all have Application.MainFormOnTaskbar set to false (totally forgot about it).

This is because I always start from a template. Looks like the template predates the Vista era :)

Today I started for the first time an app that was not a copy of that template. This explains why this default behavior is new to me :)

Anyway, I don't want "modal" forms all over in my app. So, I will stick with MainFormOnTaskbar = false. When I do want a child form to stay on top then I make it modal or use fsStayOnTop.


Initially I though this question should be deleted, but then I decided to leave it here as an extension to the Embarcadero's documentation.