EventOnBeforeDeleteControl(Args: IUiPrxControlCancelEventArgs);
Args. The parameter, which enables the user to work with event parameters.
The EventOnBeforeDeleteControl method implements the event that occurs before removing a control.
Executing the example requires a regular report that contains a control. Connect a unit to the regular report, select the connected unit an the EventsClass class as an event handler. Add links to the Report, Ui system assemblies in the unit.
Class EventsClass: ReportEvents
// Work with controls:
Sub EventOnBeforeDeleteControl(Args: IUiPrxControlCancelEventArgs);
Begin
If Not WinApplication.ConfirmationBox("Delete control?") Then
Args.Cancel := True;
End If;
End Sub EventOnBeforeDeleteControl;
End Class EventsClass;
On removing a control in the regular report it is prompted to confirm the executed action. If the answer is positive, the control is removed, otherwise, it is not.
The requirements and result of the Fore.NET example execution match with those in the Fore example.
Imports Prognoz.Platform.Interop.Report;
Imports Prognoz.Platform.Interop.Ui;
Public Class EventsClass: PrxForeNetReportUserEventsClass
// Work with controls:
Public Override Sub EventOnBeforeDeleteControl(Args: Prognoz.Platform.Interop.Report.UiPrxControlCancelEventArgs);
Var
WinAppCls: WinApplicationClass = New WinApplicationClassClass();
Begin
If Not WinAppCls.ConfirmationBox("Delete control?", Null) Then
Args.Cancel := True;
End If;
End Sub EventOnBeforeDeleteControl;
End Class EventsClass;
See also: