IWinApplicationClass.ConfirmationBox

Syntax

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

Syntax

ConfirmationBox(Message: String; ParentWindow: Prognoz.Platform.Interop.Forms.IWin32Window): 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

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.

Fore 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.

Fore.NET Example

Executing the example requires a .NET form with a button.

Imports Prognoz.Platform.Forms.Net;
Imports Prognoz.Platform.Interop.Ui;

Private Sub button1_Click(sender: System.Object; e: System.EventArgs);
Var
    WinAppCls: WinApplicationClass = New WinApplicationClassClass();
    b: boolean;
Begin
    b := WinAppCls.ConfirmationBox("Save changes?"New IWin32WindowForeAdapter(Self));
End Sub;

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

See also:

IWinApplicationClass