menu

WinForms

  • Code Examples
  • Upgrade Guide
  • User Guide
  • Demos
  • Support
  • Forums
  • Download
Class CancelListener - WindowsForms API Reference | Syncfusion

    Show / Hide Table of Contents

    Class CancelListener

    A listener class that will listen to and notify Escape key press.

    Inheritance
    System.Object
    CancelListener
    Implements
    System.Windows.Forms.IMessageFilter
    IKeyboardProcHookClient
    Inherited Members
    System.Object.Equals(System.Object)
    System.Object.Equals(System.Object, System.Object)
    System.Object.GetHashCode()
    System.Object.GetType()
    System.Object.MemberwiseClone()
    System.Object.ReferenceEquals(System.Object, System.Object)
    System.Object.ToString()
    Namespace: Syncfusion.Windows.Forms
    Assembly: Syncfusion.Shared.Base.dll
    Syntax
    public class CancelListener : IMessageFilter, IKeyboardProcHookClient
    Remarks

    As soon as you create this class, it starts listening for the Esc key press using Application.AddMessageFilter. As soon as it encounters the Escape key, it notifies the source (ICanCancel implementor) and stops listening to further Escape presses. The Release method will make it stop listening at any point.

    Constructors

    CancelListener(ICanCancel)

    Creates a new instance of the CancelListener class.

    Declaration
    public CancelListener(ICanCancel canCancel)
    Parameters
    Type Name Description
    ICanCancel canCancel

    The instance that will be notified on Escape key press.

    Methods

    Release()

    Makes this instance stop listening for Escape key press.

    Declaration
    public void Release()

    Explicit Interface Implementations

    IKeyboardProcHookClient.KeyboardHookProc(Int32, Int32)

    Declaration
    bool IKeyboardProcHookClient.KeyboardHookProc(int wParam, int lParam)
    Parameters
    Type Name Description
    System.Int32 wParam
    System.Int32 lParam
    Returns
    Type
    System.Boolean

    Implements

    System.Windows.Forms.IMessageFilter
    IKeyboardProcHookClient
    Back to top Generated by DocFX
    Copyright © 2001 - 2025 Syncfusion Inc. All Rights Reserved