Unit 'Forms' Package
[Overview][Constants][Types][Classes][Procedures and functions][Variables][Index] [#lcl]

TCustomForm.ShowModal

Displays the form as a modal Dialog.

Declaration

Source position: forms.pp line 667

public function TCustomForm.ShowModal: Integer; virtual;

Function result

The modal result for the dialog.

Description

Shows the form in a modal state and waits until it is closed by the user or by the program. Modal state means that neither the user nor the program can switch to another form already made visible before calling ShowModal.

The form must have Visible set to False when calling ShowModal. The call does not return until the form is closed. The application switches to modal state until ShowModal has completed.

ShowModal creates its own event loop using ProcessMessages.

Errors

Raises an EInvalidOperation exception if the form cannot be displayed as a modal form.