Sub OnBeforeDeleteControl(Control: IPrxControl; Var Cancel: Boolean);
Begin
//set of operators;
End Sub OnBeforeDeleteControl;
Sub OnBeforeDeleteControl(Control: IPrxControl; Var Cancel: Boolean);
Begin
//set of operators;
End Sub OnBeforeDeleteControl;
Control. Control that generated event.
Cancel. Parameter that removes a control.
The OnBeforeDeleteControl method implements the event that occurs before removing a control.
Available values of the Cancel parameter:
True. Control is removed.
False. Control is not removed.
To implement the event that occurs on changing value of a regular report control, use the ReportEvents.OnChangeControlValue method.
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.
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: