IWinApplicationClass.ConfirmationBox

Syntax

ConfirmationBox(Message: String; [ParentWindow: IWin32Window = Null]): Boolean;

Parameters

Message. Message to be displayed in the confirmation box.

ParentWindow. Parent window, for which the dialog box opens modally. The Null value is passed by default, the dialog box opens modally for the current window.

Description

The ConfirmationBox method opens a standard confirmation dialog box and returns the result of dialog box closing.

Comments

It is used only in the desktop application.

The dialog box contains two buttons Yes and No. The ConfirmationBox method returns True if the Yes button was clicked, and False if the No button was clicked.

Example

Executing the example requires a form and a button named Button1 on the form.

Sub Button1OnClick(Sender: Object; Args: IMouseEventArgs);
Var
    b: Boolean;
Begin
    b := WinApplication.ConfirmationBox("Save changes?");
End Sub Button1OnClick;

Clicking the button opens the confirmation box. The result of choice in the dialog box is available in the "b" variable.

See also:

IWinApplicationClass