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

# TScreen.CustomFormIndex

Gets the ordinal position in CustomForms for the requested form.

## Declaration

Source position: forms.pp line 1215

`public function TScreen.CustomFormIndex(`
`AForm: TCustomForm`
`):Integer;`

## Arguments

`AForm` |  | The form instance to locate in CustomForms.

## Function result

The ordinal position for the form in CustomForms, or -1 when not found.

## Description

CustomFormIndex is an Integer function used to get the position in CustomForms for the specified TCustomForm instance. It iterates over the values in CustomForms in reverse order. The return value contains the ordinal position in CustomForms where the TCustomForm instance in AForm was found, or -1 when AForm does not exist in CustomForms.

Use the FormIndex method to locate a form instance derived from TForm in the Forms property.

## See also

TScreen.CustomForms |  | Provides indexed access to the TCustomForm instances on the screen.
TScreen.Forms |  | Provides indexed access to TForm instances on the screen.
TScreen.FormIndex |  | Gets the ordinal position in Forms for the requested form.