I have an application which consists of a form with FormStyle declared as "fsStayOnTop", so that it always is shown on top of all other windows. Now I would like to temporarily show another form where the user can set some settings. That form should also be shown on top, so I change the FormStyle property of the main form to "fsNormal" and the FormStyle of the form I want to show to "fsStayOnTop". When the temporary form closes the main form gets "fsStayOnTop" again.
Now the settings form stays on top, but only until I activate it by a mouse click inside the form. When I click on another window after that, the clicked form is on top and the defined FormStyle seems to have no effect anymore. Can anyone help me with that?
Here's my FormShow and FormClose mehtod:
procedure TForm3.FormClose(Sender: TObject; var Action: TCloseAction);
begin
ScaleOpen := false;
SetForegroundWindow(TempHandle);
Form1.FormStyle := fsStayOnTop;
end;
procedure TForm3.FormShow(Sender: TObject);
begin
TempHandle := GetForegroundWindow;
OldScaleM := Form1.GetScale;
SaveChanges := False;
ScaleOpen := true;
Form1.FormStyle := fsNormal;
Form3.FormStyle := fsStayOnTop;
end;
fsStayOnTop
and not something else? – ainShowModal
when you want to show your settings form... – whosrdaddyfsStayOnTop
are always placed above any normal form even thou it has style offsStayOnTop
. – SilverWarior