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

TCustomForm.ShowModal

Show this form as a modal Dialog.

Declaration

Source position: forms.pp line 645

public function TCustomForm.ShowModal: Integer; virtual;

Function result

The modal result of the dialog.

Description

Shows the form in modal state and waits til it is closed by the user or by the program. Modal state means that neither the user nor the program can switch to forms, that were already visible before ShowModal. The form must have Visible=false when calling ShowModal. The call doesn't return until the form is closed. The application switches to modal state until then. ShowModal creates its own event loop calling ProcessMessages.

Errors

EInvalidOperation if the form cannot be shown modally.

The latest version of this document can be found at lazarus-ccr.sourceforge.net.