Mouse.Captured Property
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Gets the element that has captured the mouse.
public:
static property System::Windows::IInputElement ^ Captured { System::Windows::IInputElement ^ get(); };
public static System.Windows.IInputElement Captured { get; }
static member Captured : System.Windows.IInputElement
Public Shared ReadOnly Property Captured As IInputElement
The element captured by the mouse.
The follow example shows how to obtain the element that has mouse capture.
// Mouse.Capture returns an IInputElement.
IInputElement captureElement;
captureElement = Mouse.Captured;
// Update the Label that displays the element with mouse capture.
lblHasMouseCapture.Content = captureElement.ToString();
' Mouse.Capture returns an IInputElement.
Dim captureElement As IInputElement
captureElement = Mouse.Captured
' Update the Label that displays the element with mouse capture.
lblHasMouseCapture.Content = CType(captureElement, Object).ToString()
When an element captures the mouse, it receives mouse input whether or not the cursor is within its borders. The mouse is typically captured in this manner only during drag-and-drop operations, and retains capture until the drop action of the drag-and-drop operation occurs.
Produkt | Versioner |
---|---|
.NET Framework | 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1 |
Windows Desktop | 3.0, 3.1, 5, 6, 7, 8, 9, 10 |
Feedback om .NET
.NET är ett öppen källkod projekt. Välj en länk för att ge feedback: