共用方式為


Mouse.Captured 屬性

定義

取得已捕捉滑鼠的項目。

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

屬性值

滑鼠所捕捉的項目。

範例

下列範例示範如何取得具有滑鼠擷取的專案。

// 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()

備註

當元素擷取滑鼠時,無論游標是否在其框線內,它都會收到滑鼠輸入。 滑鼠通常只會在拖放作業期間以這種方式擷取,並保留擷取,直到拖放作業的拖放動作發生為止。

適用於