Gets or sets a value indicating whether the event should be canceled.
Assembly: System (in System.dll)
The following example uses CancelEventArgs and a CancelEventHandler to handle the FormClosing event of a Form. This code assumes that you have created a Form with a class-level Boolean variable named isDataSaved. It also assumes that you have added a statement to invoke the OtherInitialize method from the form's Load method or the constructor (after the call to InitializeComponent).
Available since 8
Available since 1.1
Portable Class Library
Supported in: portable .NET platforms
Available since 3.0
Windows Phone Silverlight
Available since 7.0
Available since 8.1