MouseDevice.Capture 메서드

정의

지정한 요소로 마우스 입력을 캡처합니다.

오버로드

Capture(IInputElement)

지정한 요소로 마우스 이벤트를 캡처합니다.

Capture(IInputElement, CaptureMode)

지정한 CaptureMode를 사용하여 지정한 요소로 마우스 입력을 캡처합니다.

설명

요소가 마우스를 캡처하면 커서가 테두리 내에 있는지 여부에 관계없이 마우스 입력을 받습니다.

CaptureMode 지정하지 않으면 기본값 CaptureMode 은 입니다 Element.

마우스 캡처를 해제하려면 캡처할 요소로 전달 null 을 호출 Capture 합니다.

또는 MouseUp 이벤트가 발생할 때 MouseDown 마우스가 캡처되고 입력이 마우스 PreviewMouseDownOutsideCapturedElement 아래의 요소로 가지 않는 경우 먼저 PreviewMouseUpOutsideCapturedElement 발생합니다. 이렇게 하면 캡처된 요소가 및 MouseUp 이벤트가 라우팅되기 전에 캡처를 MouseDown 해제할 수 있습니다.

Capture(IInputElement)

지정한 요소로 마우스 이벤트를 캡처합니다.

public:
 bool Capture(System::Windows::IInputElement ^ element);
public bool Capture (System.Windows.IInputElement element);
member this.Capture : System.Windows.IInputElement -> bool
Public Function Capture (element As IInputElement) As Boolean

매개 변수

element
IInputElement

마우스를 캡처할 요소입니다.

반환

요소에 마우스가 캡처되었으면 true이고, 그렇지 않으면 false입니다.

예외

elementUIElement 또는 ContentElement가 아닌 경우

설명

요소가 마우스를 캡처하면 커서가 테두리 내에 있는지 여부에 관계없이 마우스 입력을 받습니다.

CaptureMode 지정하지 않으면 기본값 CaptureMode 은 입니다 Element.

마우스 캡처를 해제하려면 캡처할 요소로 전달 null 을 호출 Capture 합니다.

또는 MouseUp 이벤트가 발생할 때 MouseDown 마우스가 캡처되고 입력이 마우스 PreviewMouseDownOutsideCapturedElement 아래의 요소로 가지 않는 경우 먼저 PreviewMouseUpOutsideCapturedElement 발생합니다. 이렇게 하면 캡처된 요소가 및 MouseUp 이벤트가 라우팅되기 전에 캡처를 MouseDown 해제할 수 있습니다.

적용 대상

Capture(IInputElement, CaptureMode)

지정한 CaptureMode를 사용하여 지정한 요소로 마우스 입력을 캡처합니다.

public:
 bool Capture(System::Windows::IInputElement ^ element, System::Windows::Input::CaptureMode captureMode);
[System.Security.SecurityCritical]
public bool Capture (System.Windows.IInputElement element, System.Windows.Input.CaptureMode captureMode);
public bool Capture (System.Windows.IInputElement element, System.Windows.Input.CaptureMode captureMode);
[<System.Security.SecurityCritical>]
member this.Capture : System.Windows.IInputElement * System.Windows.Input.CaptureMode -> bool
member this.Capture : System.Windows.IInputElement * System.Windows.Input.CaptureMode -> bool
Public Function Capture (element As IInputElement, captureMode As CaptureMode) As Boolean

매개 변수

element
IInputElement

마우스를 캡처할 요소입니다.

captureMode
CaptureMode

사용할 캡처 정책입니다.

반환

요소에 마우스가 캡처되었으면 true이고, 그렇지 않으면 false입니다.

특성

예외

elementUIElement 또는 ContentElement가 아닌 경우

captureMode은 유효한 CaptureMode이 아닙니다.

설명

요소가 마우스를 캡처하면 커서가 테두리 내에 있는지 여부에 관계없이 마우스 입력을 받습니다.

마우스 캡처를 해제하려면 캡처할 요소로 전달 null 을 호출 Capture 합니다.

또는 MouseUp 이벤트가 발생할 때 MouseDown 마우스가 캡처되고 입력이 마우스 PreviewMouseDownOutsideCapturedElement 아래의 요소로 가지 않는 경우 먼저 PreviewMouseUpOutsideCapturedElement 발생합니다. 이렇게 하면 캡처된 요소가 및 MouseUp 이벤트가 라우팅되기 전에 캡처를 MouseDown 해제할 수 있습니다.

적용 대상