[Overview][Constants][Types][Classes][Procedures and functions][Variables][Index] | Reference for unit 'Forms' (#lcl)

# TApplication.RemoveStayOnTop

Removes the StayOnTop attribute from all visible forms in the application.

## Declaration

Source position: forms.pp line 1618

`public procedure TApplication.RemoveStayOnTop(`
`const ASystemTopAlso: Boolean = False`
`);`

## Arguments

`ASystemTopAlso` |  | Indicates whether system dialogs/forms with stay on top set are also updated. Default value is False.

## Description

RemoveStayOnTop is a method used to remove the stay on top attribute from visible forms in the application.

RemoveStayOnTop calls the AppRemoveStayOnTopFlags method in the widgetset class instance. ASystemTopAlso indicates whether system dialogs/forms with the stay on top attribute are included in the list of forms affected in the method. The default value for ASystemTopAlso is False, and omits these forms from the list.

RemoveStayOnTop builds the internal list of forms used in the RestoreStayOnTop method. It adds each visible form instance in Screen.CustomForms to the internal list, and sets its FormStyle property to fsNormal. Any form without a Parent, not Visible, or without FormStyle set to fsStayOnTop is not added to the list or affected in the method.

RemoveStayOnTop is called from methods like ModalStarted and HandleException.

See RestoreStayOnTop for the actions performed to restore the stay on top attribute to the list of forms.

## See also

TApplication.RestoreStayOnTop |  | Restores StayOnTop for all forms changed by RemoveStayOnTop.
TApplication.ModalStarted |  | Called when a modal form display is started.
TApplication.HandleException |  | HandleException method for handling an exception; attempts to maintain program execution if possible, otherwise exits gracefully.
TCustomForm.FormStyle |  | Indicates the style for the form.
TCustomForm.Visible |  | Indicates if the control is visible on its parent.
Screen |  | The TScreen singleton for the application.
TScreen.CustomForms |  | Provides indexed access to the TCustomForm instances on the screen.
TScreen.CustomFormCount |  | Number of TCustomForm form instances in the CustomForms property.
TControl.Parent |  | The control within which the control is shown.
TFormStyle |  | Defines special form behavior.
fsAllNonSystemStayOnTop |  | Set of form styles except those which make a form stay on top of all other forms of the system.