System.Windows.Forms.Control.MouseCaptureChanged Event

Occurs when the control loses mouse capture.

Syntax

public event EventHandler MouseCaptureChanged

Remarks

In rare scenarios, you might need to detect unexpected input. For example, consider the following scenarios.

  • During a mouse operation, the user opens the Start menu by pressing the Windows key or CTRL+ESC.

  • During a mouse operation, the user switches to another program by pressing ALT+TAB.

  • During a mouse operation, another program displays a window or a message box that takes focus away from the current application.

Mouse operations can include clicking and holding the mouse on a form or a control, or performing a mouse drag operation. If you have to detect when a form or a control loses mouse capture for these and related unexpected scenarios, you can use the Control.MouseCaptureChanged event.

Requirements

Namespace: System.Windows.Forms
Assembly: System.Windows.Forms (in System.Windows.Forms.dll)
Assembly Versions: 2.0.0.0