IWinApplicationClass.YesNoCancelBox

Syntax

YesNoCancelBox(

Message: String;

Var YesPressed: Boolean;

[ParentWindow: IWin32Window = Null]): Boolean;

Parameters

Message. The message to be displayed in the confirmation box.

YesPressed. The variable that contains True if the Yes button is clicked, or False if any other button is clicked.

ParentWindow. The 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 YesNoCancelBox method opens a standard confirmation dialog box containing three options and returns the result of closing the dialog box.

Comments

It is used only in the desktop application.

This method returns True if the Yes or No button is clicked, or False if the Cancel button is 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, b1: Boolean;
Begin
    b := WinApplication.YesNoCancelBox("Save modified data?", b1);
End Sub Button1OnClick;

Clicking the button opens the confirmation box with the specified message.

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, b1: Boolean;
Begin
    b := WinAppCls.YesNoCancelBox("Save modified data?"Var b1, New IWin32WindowForeAdapter(Self));
End Sub;

Clicking the button opens the confirmation box with the specified message.

See also:

IWinApplicationClass