MessageBox (Delphi)
Description
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.
Code
procedure TForm1.Button1Click(Sender: TObject);
begin
with Application do
begin
NormalizeTopMosts;
MessageBox('This should be on top.', 'Look', MB_OK); // [smbOK]
RestoreTopMosts;
end;
end;
Uses
- Vcl.Forms.TApplication.MessageBox ( fr | de | ja )
- Vcl.Forms.TApplication.NormalizeTopMosts ( fr | de | ja )
- Vcl.Forms.TApplication.RestoreTopMosts ( fr | de | ja )