Vcl.Forms.TCustomForm.ShowModal

From RAD Studio API Documentation
Jump to: navigation, search

Delphi

function ShowModal: Integer; virtual;

C++

virtual int __fastcall ShowModal();

Properties

Type Visibility Source Unit Parent
function public
Vcl.Forms.pas
Vcl.Forms.hpp
Vcl.Forms TCustomForm

Description

Shows a form as a modal dialog.

Use ShowModal to show a form as a modal form. A modal form is one where the application can't continue to run until the form is closed. Thus, ShowModal does not return until the form closes. When the form closes, it returns the value of the ModalResult property.

To close a modal form, set its ModalResult property to a nonzero value.

Note: If the form contains buttons with a ModalResult property set to a value other than mrNone, the form automatically closes when the user clicks one of those buttons and returns the ModalResult value as the return value of ShowModal.

You can check the return value against common return values using the global IsAbortResult, IsAnAllResult, IsNegativeResult, or IsPositiveResult functions.

See Also


Code Examples