MouseDevice 類別

定義

表示滑鼠裝置。Represents a mouse device.

public ref class MouseDevice abstract : System::Windows::Input::InputDevice
public abstract class MouseDevice : System.Windows.Input.InputDevice
type MouseDevice = class
    inherit InputDevice
Public MustInherit Class MouseDevice
Inherits InputDevice
繼承

備註

MouseDevice 支援基礎結構,但不適合直接從您Windows Presentation Foundation (WPF)Windows Presentation Foundation (WPF)的程式碼使用。The MouseDevice supports the Windows Presentation Foundation (WPF)Windows Presentation Foundation (WPF) infrastructure and is not intended to be used directly from your code.

針對滑鼠相關輸入, 請使用Mouse類別。For mouse related input, use the Mouse class. Mouse類別代表應用程式的滑鼠, 並提供方法、屬性和反映滑鼠狀態的事件。The Mouse class represents the mouse to an application and provides methods, properties, and events that reflect the state of the mouse.

屬性

ActiveSource

取得報告這個裝置之輸入的 PresentationSourceGets the PresentationSource that is reporting input for this device.

Captured

取得滑鼠捕捉的 IInputElementGets the IInputElement that is captured by the mouse.

DirectlyOver

取得滑鼠指標位於其正上方的項目。Gets the element that the mouse pointer is directly over.

Dispatcher

取得與這個 Dispatcher 關聯的 DispatcherObjectGets the Dispatcher this DispatcherObject is associated with.

(繼承來源 DispatcherObject)
LeftButton

取得這個滑鼠裝置左鍵的狀態。Gets the state of the left mouse button of this mouse device.

MiddleButton

這個滑鼠裝置中鍵的狀態。The state of the middle button of this mouse device.

OverrideCursor

取得或設定整個應用程式的游標。Gets or sets the cursor for the entire application.

RightButton

取得這個滑鼠裝置右鍵的狀態。Gets the state of the right button of this mouse device.

Target

取得來自這個滑鼠裝置之輸入要傳送到的 IInputElementGets the IInputElement that the input from this mouse device is sent to.

XButton1

取得這個滑鼠裝置第一個擴充按鍵的狀態。Gets the state of the first extended button on this mouse device.

XButton2

取得這個滑鼠裝置第二個擴充按鍵的狀態。Gets the state of the second extended button of this mouse device.

方法

Capture(IInputElement)

將滑鼠事件捕捉至指定的項目。Captures mouse events to the specified element.

Capture(IInputElement, CaptureMode)

使用指定的 CaptureMode 將滑鼠輸入捕捉至指定項目。Captures mouse input to the specified element using the specified CaptureMode.

CheckAccess()

判斷呼叫的執行是否可以存取這個 DispatcherObjectDetermines whether the calling thread has access to this DispatcherObject.

(繼承來源 DispatcherObject)
Equals(Object)

判斷指定的物件是否等於目前的物件。Determines whether the specified object is equal to the current object.

(繼承來源 Object)
GetButtonState(MouseButton)

取得指定滑鼠按鈕的狀態。Gets the state of the specified mouse button.

GetClientPosition()

計算滑鼠指標的位置 (在工作區座標中)。Calculates the position of the mouse pointer, in client coordinates.

GetClientPosition(PresentationSource)

在指定的 PresentationSource 中,計算滑鼠指標的位置 (在工作區座標中)。Calculates the position of the mouse pointer, in client coordinates, in the specified PresentationSource.

GetHashCode()

作為預設雜湊函數。Serves as the default hash function.

(繼承來源 Object)
GetPosition(IInputElement)

取得相對於指定之項目的滑鼠位置。Gets the position of the mouse relative to a specified element.

GetScreenPosition()

計算滑鼠指標的螢幕位置。Calculates the screen position of the mouse pointer.

GetType()

取得目前執行個體的 TypeGets the Type of the current instance.

(繼承來源 Object)
MemberwiseClone()

建立目前 Object 的淺層複製。Creates a shallow copy of the current Object.

(繼承來源 Object)
SetCursor(Cursor)

將滑鼠指標設定為指定的 CursorSets the mouse pointer to the specified Cursor

Synchronize()

強制滑鼠重新同步處理。Forces the mouse to resynchronize.

ToString()

傳回代表目前物件的字串。Returns a string that represents the current object.

(繼承來源 Object)
UpdateCursor()

強制滑鼠更新游標。Forces the mouse cursor to update.

VerifyAccess()

請強制執行可以存取這個 DispatcherObject 的呼叫執行緒。Enforces that the calling thread has access to this DispatcherObject.

(繼承來源 DispatcherObject)

適用於

另請參閱