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

# TScreen.GetCurrentModalFormZIndex

Returns the index of the top-most modal form in CustomFormsZOrdered.

## Declaration

Source position: forms.pp line 1222

`public function TScreen.GetCurrentModalFormZIndex: Integer;`

## Function result

The index for the form, or -1 if no modal form is active.

## Description

Visits the form instances in CustomFormsZOrdered to find the first TCustomForm instance with the value fsModal in its FormState property.

Returns -1 if a modal form is not found in the CustomFormsZOrdered property.

Called from the GetCurrentModalForm method.