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

# TFindDialog.CalcPosition

Determines the position for the dialog form and captures its coordinates.

## Declaration

Source position: dialogs.pp line 509

`protected procedure TFindDialog.CalcPosition(`
`aForm: TForm`
`);`

## Arguments

`aForm` |  | TForm instance examined in the method.

## Description

CalcPosition ensures that both the form and the class instance are updated with the location where the form is displayed. The Position property in the form instance is updated to display the form in the correct relative location.

At design-time, the dialog form is aligned to the center of the Screen (poScreenCenter).

At run-time, the dialog form is aligned to the center of the main form in the application (poMainFormCenter) when the Left and Top coordinates in the dialog are set to their unassigned values. The Left and Top coordinates are stored in the class instance for subsequent use in the CreateForm method.

## See also

TFindDialog.CreateForm |  | Creates and configures the internal form displayed for the dialog.
TFindDialog.Left |  | Coordinate for the Left side of the dialog form.
TFindDialog.Top |  | Coordinate for the Top edge of the dialog form.
TForm.Position |  | The initial placement for the form.
TControl.Left |  | The client coordinate with the left edge for the control.
TControl.Top |  | The client coordinate for the top edge of the control.