RAD Studio VCL Reference
ContentsIndex
PreviousUpNext
TApplication.RestoreTopMosts Method

Restores forms designated as fsStayOnTop to be topmost again.

Pascal
procedure RestoreTopMosts;
C++
__fastcall RestoreTopMosts();

Use RestoreTopMosts to return forms that were originally designated as topmost forms (FormStyle is fsStayOnTop), then temporarily changed to be non-topmost forms with the NormalizeTopMosts or NormalizeAllTopMosts method, to a topmost position.  

C++ Examples: 

 

/*
The following code causes "stay on top" forms to allow a 
MessageBox to appear on top. After the message box is 
closed, the topmost forms are restored so that they continue
to float to the top.
*/
void __fastcall TForm1::Button1Click(TObject *Sender)
{
Application->NormalizeTopMosts();
Application->MessageBox("This should be on top.", "Look", MB_OKCANCEL);
Application->RestoreTopMosts();
}

 

Delphi Examples: 

{
The following code causes "stay on top" forms to allow a 
MessageBox to appear on top. After the message box is 
closed, the topmost forms are restored so that they continue
to float to the top.
}
procedure TForm1.Button1Click(Sender: TObject);
begin
  with Application do
  begin
    NormalizeTopMosts;
    MessageBox('This should be on top.', 'Look', MB_OK);    // [smbOK]
    RestoreTopMosts;
  end;
end;

 

Copyright(C) 2008 CodeGear(TM). All Rights Reserved.
What do you think about this topic? Send feedback!