Export (0) Print
Expand All
Expand Minimize

Control.Capture Property

Gets or sets a value indicating whether the control has captured the mouse.

[Visual Basic]
Public Property Capture As Boolean
[C#]
public bool Capture {get; set;}
[C++]
public: __property bool get_Capture();
public: __property void set_Capture(bool);
[JScript]
public function get Capture() : Boolean;
public function set Capture(Boolean);

Property Value

true if the control has captured the mouse; otherwise, false.

Remarks

When a control has captured the mouse, it receives mouse input whether or not the cursor is within its borders. The mouse is typically only captured during drag operations.

Only the foreground window can capture the mouse. When a background window attempts to do so, the window receives messages only for mouse events that occur when the mouse cursor is within the visible portion of the window. Also, even if the foreground window has captured the mouse, the user can still click another window, bringing it to the foreground.

When the mouse is captured, shortcut keys do not work.

Requirements

Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family, .NET Compact Framework

.NET Framework Security: 

See Also

Control Class | Control Members | System.Windows.Forms Namespace | Cursor

Show:
© 2014 Microsoft