ReportEvents.OnBeforeDeleteControl

Fore Syntax

Sub OnBeforeDeleteControl(Control: IPrxControl; Var Cancel: Boolean);

Begin

//set of operators;

End Sub OnBeforeDeleteControl;

Fore.NET Syntax

Sub OnBeforeDeleteControl(Control: IPrxControl; Var Cancel: Boolean);

Begin

//set of operators;

End Sub OnBeforeDeleteControl;

Parameters

Control. Control that generated event.

Cancel. Parameter that removes a control.

Description

The OnBeforeDeleteControl method implements the event that occurs before removing a control.

Comments

Available values of the Cancel parameter:

To implement the event that occurs on changing value of a regular report control, use the ReportEvents.OnChangeControlValue method.

Fore Example

The specified class is a handler of regular report events.

Add a link to the Ui system assembly.

Class EventsClass: ReportEvents
Public Sub OnBeforeDeleteControl(Control: IPrxControl; Var Cancel: Boolean);
Begin
    If Not WinApplication.ConfirmationBox("Remove control?"Then
        Cancel := True;
    End If;
End Sub OnBeforeDeleteControl;
End Class EventsClass;

Before removing a control it is prompted to confirm the executed action. If the answer is positive, the control is removed, otherwise, it is not.

Fore.NET Example

The requirements and result of the Fore.NET example execution match with those in the Fore example.

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

Public Class EventsClass: PrxForeNetReportUserEventsClass
Public Override Sub OnBeforeDeleteControl(Control: IPrxControl; Var Cancel: Boolean);
Var
    WinAppCls: WinApplicationClassClass = New WinApplicationClassClass();
Begin
    If Not WinAppCls.ConfirmationBox("Remove control?"New IWin32WindowForeAdapter(Self)) Then
        Cancel := True;
    End If;
End Sub OnBeforeDeleteControl;
End Class EventsClass;

See also:

ReportEvents