Name

CancelEventArgs

Synopsis

This class should be used as the base for classes that encapsulate the data for events that can be canceled.

It provides a Cancel property that can be set by the client of the event to indicate that the action that raised the event should be aborted.


public class CancelEventArgs : EventArgs {

// Public Constructors

   public CancelEventArgs();

   public CancelEventArgs(bool cancel);

// Public Instance Properties

   public bool Cancel{set; get; }

}

Hierarchy

System.Object System.EventArgs CancelEventArgs

Subclasses

System.Drawing.Printing.PrintEventArgs, System.Windows.Forms.{InputLanguageChangingEventArgs, TreeViewCancelEventArgs}

Passed To

CancelEventHandler.{BeginInvoke(), Invoke()}, System.Windows.Forms.Control.OnValidating(), System.Windows.Forms.FileDialog.OnFileOk(), System.Windows.Forms.Form.OnClosing()

Get .NET Windows Forms in a Nutshell now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.