FMX.StdCtrls.TCornerButton.ModalResult
Delphi
property ModalResult: TModalResult read FModalResult write FModalResult default 0;
C++
__property ModalResult = {default=0};
Properties
Type | Visibility | Source | Unit | Parent |
---|---|---|---|---|
property | published | FMX.StdCtrls.pas FMX.StdCtrls.hpp |
FMX.StdCtrls | TCornerButton |
Description
Determines whether and how the button closes its (modal) parent form.
FMX.StdCtrls.TCornerButton.ModalResult inherits from FMX.StdCtrls.TCustomButton.ModalResult. All content below this line refers to FMX.StdCtrls.TCustomButton.ModalResult.
Determines whether and how the button closes its (modal) parent form.
Setting the ModalResult property of a button is an easy way to make clicking the button to close the parent modal form. When a button is clicked, the ModalResult property of its parent form is set to the same value as the ModalResult property of a button.
For example, if a dialog box has OK and Cancel buttons, their ModalResult properties could be set at design time to mrOk
and mrCancel
, respectively. At run time, clicking the OK button changes the ModalResult property of the dialog box to mrOk
, and clicking the Cancel button changes the ModalResult property of the dialog box to mrCancel
. Unless further processing is required, no OnClick event handlers are required for the buttons.
The following table lists the constants defined in the System.UITypes unit to be used for the ModalResult property of the TModalResult type.
Constant | Value | Meaning |
---|---|---|
|
0 |
None. Used as a default value before the user exits. |
|
idOK = 1 |
The user exited with the OK button. |
|
idCancel = 2 |
The user exited with the CANCEL button. |
|
idAbort = 3 |
The user exited with the ABORT button. |
|
idRetry = 4 |
The user exited with the RETRY button. |
|
idIgnore = 5 |
The user exited with the IGNORE button. |
|
idYes = 6 |
The user exited with the YES button. |
|
idNo = 7 |
The user exited with the NO button. |
|
idClose = 8 |
The user exited with the CLOSE button. |
|
idHelp = 9 |
The user exited with the HELP button. |
|
idTryAgain = 10 |
The user exited with the TRY AGAIN button. |
|
idContinue = 11 |
The user exited with the CONTINUE button. |
|
mrContinue + 1 (12 or $C) |
The user exited with the ALL button. |
|
mrAll +1 (13 or $D) |
The user exited with the NO TO ALL button. |
|
mrNoToAll +1 (14 or $E) |
The user exited with the YES TO ALL button. |
You can check a ModalResult value using the global IsAbortResult, IsAnAllResult, IsNegativeResult, or IsPositiveResult functions, and use the StripAllFromResult function to convert ModalResult values that refer to "ALL" buttons to identifying values corresponding to simple buttons (Ok, No, or Yes).