IInputElement IInputElement IInputElement IInputElement Interface

定義

透過 Windows Presentation Foundation (WPF) 項目建立一般事件,以及與事件相關的屬性和用以處理基本輸入的方法。Establishes the common events and also the event-related properties and methods for basic input processing by Windows Presentation Foundation (WPF) elements.

public interface class IInputElement
public interface IInputElement
type IInputElement = interface
Public Interface IInputElement
衍生

備註

重要

雖然此介面是公用的, 但不適合在應用程式或架構建立案例中執行。Although this interface is public, it is not intended to be implemented in application or framework-building scenarios. 這個介面是公用的, 因為將WPFWPF核心連接WPFWPF到架構的繼承需求。This interface is public because of the inheritance requirements for connecting the WPFWPF core to the WPFWPF framework. 您也可以使用這個介面做為轉換機制, 強制輸入事件和屬性會來自FrameworkElementFrameworkContentElement, 這可以在相同的輸入模型中處理。You can also use this interface as a casting mechanism to enforce that the input events and properties will come from either a FrameworkElement or FrameworkContentElement, which can be handled in the same input model. 如需詳細資訊, 請參閱WPF 架構, 另請參閱基底元素總覽For more information, see WPF Architecture and also see Base Elements Overview.

屬性

Focusable Focusable Focusable Focusable

取得或設定值,指出焦點可否設在這個項目。Gets or sets a value that indicates whether focus can be set to this element.

IsEnabled IsEnabled IsEnabled IsEnabled

取得值,這個值表示這個項目是否已在 使用者介面 (UI)user interface (UI) 中啟用。Gets a value that indicates whether this element is enabled in the 使用者介面 (UI)user interface (UI).

IsKeyboardFocused IsKeyboardFocused IsKeyboardFocused IsKeyboardFocused

取得值,指出這個項目是否具有鍵盤焦點。Gets a value that indicates whether this element has keyboard focus.

IsKeyboardFocusWithin IsKeyboardFocusWithin IsKeyboardFocusWithin IsKeyboardFocusWithin

取得值,指出鍵盤焦點是否在項目範圍內的任何位置,包括鍵盤焦點是否在任何視覺子項目的範圍內。Gets a value that indicates whether keyboard focus is anywhere inside the element bounds, including if keyboard focus is inside the bounds of any visual child elements.

IsMouseCaptured IsMouseCaptured IsMouseCaptured IsMouseCaptured

取得值,指出是否將滑鼠擷取至這個項目。Gets a value that indicates whether the mouse is captured to this element.

IsMouseDirectlyOver IsMouseDirectlyOver IsMouseDirectlyOver IsMouseDirectlyOver

取得值,該值表示滑鼠指標在最嚴格的點擊測試意義上,是否在這個項目上方。Gets a value that indicates whether the mouse pointer is over this element in the strictest hit testing sense.

IsMouseOver IsMouseOver IsMouseOver IsMouseOver

取得值,這個值表示滑鼠指標是否位在這個項目上方 (包括其範圍內的視覺子項目)。Gets a value that indicates whether the mouse pointer is located over this element (including visual children elements that are inside its bounds).

IsStylusCaptured IsStylusCaptured IsStylusCaptured IsStylusCaptured

取得值,指出是否將手寫筆擷取至這個項目。Gets a value that indicates whether the stylus is captured to this element.

IsStylusDirectlyOver IsStylusDirectlyOver IsStylusDirectlyOver IsStylusDirectlyOver

取得值,該值表示手寫筆在最嚴格的點擊測試意義上,是否在這個項目上方。Gets a value that indicates whether the stylus is over this element in the strictest hit testing sense.

IsStylusOver IsStylusOver IsStylusOver IsStylusOver

取得值,這個值表示手寫筆是否位在這個項目上方 (或其範圍內的視覺子項目上方)。Gets a value that indicates whether the stylus is located over this element (or over visual child elements that are inside its bounds).

方法

AddHandler(RoutedEvent, Delegate) AddHandler(RoutedEvent, Delegate) AddHandler(RoutedEvent, Delegate) AddHandler(RoutedEvent, Delegate)

將特定路由事件的路由事件處理常式加入項目中。Adds a routed event handler for a specific routed event to an element.

CaptureMouse() CaptureMouse() CaptureMouse() CaptureMouse()

嘗試強制將滑鼠的捕捉給這個項目。Attempts to force capture of the mouse to this element.

CaptureStylus() CaptureStylus() CaptureStylus() CaptureStylus()

嘗試強制將手寫筆的捕捉給這個項目。Attempts to force capture of the stylus to this element.

Focus() Focus() Focus() Focus()

嘗試將鍵盤的焦點放在這個項目上。Attempts to focus the keyboard on this element.

RaiseEvent(RoutedEventArgs) RaiseEvent(RoutedEventArgs) RaiseEvent(RoutedEventArgs) RaiseEvent(RoutedEventArgs)

引發由所提供之 RoutedEvent 內的 RoutedEventArgs 屬性所指定的路由事件。Raises the routed event that is specified by the RoutedEvent property within the provided RoutedEventArgs.

ReleaseMouseCapture() ReleaseMouseCapture() ReleaseMouseCapture() ReleaseMouseCapture()

如果這個項目保有滑鼠捕捉,則釋放捕捉。Releases the mouse capture, if this element holds the capture.

ReleaseStylusCapture() ReleaseStylusCapture() ReleaseStylusCapture() ReleaseStylusCapture()

如果這個項目保有手寫筆捕捉,則釋放捕捉。Releases the stylus capture, if this element holds the capture.

RemoveHandler(RoutedEvent, Delegate) RemoveHandler(RoutedEvent, Delegate) RemoveHandler(RoutedEvent, Delegate) RemoveHandler(RoutedEvent, Delegate)

移除這個項目中所指定路由事件處理常式的所有執行個體。Removes all instances of the specified routed event handler from this element.

事件

GotKeyboardFocus GotKeyboardFocus GotKeyboardFocus GotKeyboardFocus

鍵盤以此元素為焦點時發生。Occurs when the keyboard is focused on this element.

GotMouseCapture GotMouseCapture GotMouseCapture GotMouseCapture

元素擷取滑鼠時發生。Occurs when the element captures the mouse.

GotStylusCapture GotStylusCapture GotStylusCapture GotStylusCapture

元素擷取手寫筆時發生。Occurs when the element captures the stylus.

KeyDown KeyDown KeyDown KeyDown

鍵盤以此元素為焦點且按下按鍵時發生。Occurs when a key is pressed while the keyboard is focused on this element.

KeyUp KeyUp KeyUp KeyUp

鍵盤以此元素為焦點且放開按鍵時發生。Occurs when a key is released while the keyboard is focused on this element.

LostKeyboardFocus LostKeyboardFocus LostKeyboardFocus LostKeyboardFocus

鍵盤不再以此元素為焦點時發生。Occurs when the keyboard is no longer focused on this element.

LostMouseCapture LostMouseCapture LostMouseCapture LostMouseCapture

此元素失去滑鼠擷取時發生。Occurs when this element loses mouse capture.

LostStylusCapture LostStylusCapture LostStylusCapture LostStylusCapture

此元素失去手寫筆擷取時發生。Occurs when this element loses stylus capture.

MouseEnter MouseEnter MouseEnter MouseEnter

滑鼠指標進入此元素的邊界時發生。Occurs when the mouse pointer enters the bounds of this element.

MouseLeave MouseLeave MouseLeave MouseLeave

滑鼠指標離開此元素的邊界時發生。Occurs when the mouse pointer leaves the bounds of this element.

MouseLeftButtonDown MouseLeftButtonDown MouseLeftButtonDown MouseLeftButtonDown

滑鼠指標在元素上方且按下滑鼠左按鈕時發生。Occurs when the left mouse button is pressed while the mouse pointer is over the element.

MouseLeftButtonUp MouseLeftButtonUp MouseLeftButtonUp MouseLeftButtonUp

滑鼠指標在元素上方且放開滑鼠左按鈕時發生。Occurs when the left mouse button is released while the mouse pointer is over the element.

MouseMove MouseMove MouseMove MouseMove

滑鼠指標在元素上方且移動滑鼠指標時發生。Occurs when the mouse pointer moves while the mouse pointer is over the element.

MouseRightButtonDown MouseRightButtonDown MouseRightButtonDown MouseRightButtonDown

滑鼠指標在元素上方且按下滑鼠右按鈕時發生。Occurs when the right mouse button is pressed while the mouse pointer is over the element.

MouseRightButtonUp MouseRightButtonUp MouseRightButtonUp MouseRightButtonUp

滑鼠指標在元素上方且放開滑鼠右按鈕時發生。Occurs when the right mouse button is released while the mouse pointer is over the element.

MouseWheel MouseWheel MouseWheel MouseWheel

當滑鼠指標位於這個項目上方而移動滑鼠滾輪時發生。Occurs when the mouse wheel moves while the mouse pointer is over this element.

PreviewGotKeyboardFocus PreviewGotKeyboardFocus PreviewGotKeyboardFocus PreviewGotKeyboardFocus

鍵盤以此元素為焦點時發生。Occurs when the keyboard is focused on this element.

PreviewKeyDown PreviewKeyDown PreviewKeyDown PreviewKeyDown

鍵盤以此元素為焦點且按下按鍵時發生。Occurs when a key is pressed while the keyboard is focused on this element.

PreviewKeyUp PreviewKeyUp PreviewKeyUp PreviewKeyUp

鍵盤以此元素為焦點且放開按鍵時發生。Occurs when a key is released while the keyboard is focused on this element.

PreviewLostKeyboardFocus PreviewLostKeyboardFocus PreviewLostKeyboardFocus PreviewLostKeyboardFocus

鍵盤不再以此元素為焦點時發生。Occurs when the keyboard is no longer focused on this element.

PreviewMouseLeftButtonDown PreviewMouseLeftButtonDown PreviewMouseLeftButtonDown PreviewMouseLeftButtonDown

滑鼠指標在元素上方且按下滑鼠左按鈕時發生。Occurs when the left mouse button is pressed while the mouse pointer is over the element.

PreviewMouseLeftButtonUp PreviewMouseLeftButtonUp PreviewMouseLeftButtonUp PreviewMouseLeftButtonUp

滑鼠指標在元素上方且放開滑鼠左按鈕時發生。Occurs when the left mouse button is released while the mouse pointer is over the element.

PreviewMouseMove PreviewMouseMove PreviewMouseMove PreviewMouseMove

滑鼠指標在元素上方且移動滑鼠指標時發生。Occurs when the mouse pointer moves while the mouse pointer is over the element.

PreviewMouseRightButtonDown PreviewMouseRightButtonDown PreviewMouseRightButtonDown PreviewMouseRightButtonDown

滑鼠指標在元素上方且按下滑鼠右按鈕時發生。Occurs when the right mouse button is pressed while the mouse pointer is over the element.

PreviewMouseRightButtonUp PreviewMouseRightButtonUp PreviewMouseRightButtonUp PreviewMouseRightButtonUp

滑鼠指標在元素上方且放開滑鼠右按鈕時發生。Occurs when the right mouse button is released while the mouse pointer is over the element.

PreviewMouseWheel PreviewMouseWheel PreviewMouseWheel PreviewMouseWheel

當滑鼠指標位於這個項目上方而移動滑鼠滾輪時發生。Occurs when the mouse wheel moves while the mouse pointer is over this element.

PreviewStylusButtonDown PreviewStylusButtonDown PreviewStylusButtonDown PreviewStylusButtonDown

當手寫筆位於這個項目上方而使用者按下手寫筆按鈕時發生。Occurs when the stylus button is pressed down while the stylus is over this element.

PreviewStylusButtonUp PreviewStylusButtonUp PreviewStylusButtonUp PreviewStylusButtonUp

當手寫筆位於這個項目上方而使用者放開手寫筆按鈕時發生。Occurs when the stylus button is released while the stylus is over this element.

PreviewStylusDown PreviewStylusDown PreviewStylusDown PreviewStylusDown

手寫筆在此項目上方且碰觸數位板時發生。Occurs when the stylus touches the digitizer while over this element.

PreviewStylusInAirMove PreviewStylusInAirMove PreviewStylusInAirMove PreviewStylusInAirMove

手寫筆在項目上方移動,但沒有碰觸數位板時發生。Occurs when the stylus moves over an element, but without touching the digitizer.

PreviewStylusInRange PreviewStylusInRange PreviewStylusInRange PreviewStylusInRange

手寫筆靠近數位板而被偵測到時發生。Occurs when the stylus is close enough to the digitizer to be detected.

PreviewStylusMove PreviewStylusMove PreviewStylusMove PreviewStylusMove

手寫筆在元素上方且移動手寫筆時發生。Occurs when the stylus moves while the stylus is over the element.

PreviewStylusOutOfRange PreviewStylusOutOfRange PreviewStylusOutOfRange PreviewStylusOutOfRange

手寫筆遠離數位板而無法被偵測到時發生。Occurs when the stylus is too far from the digitizer to be detected.

PreviewStylusSystemGesture PreviewStylusSystemGesture PreviewStylusSystemGesture PreviewStylusSystemGesture

在偵測到其中一個手寫筆筆勢時發生,例如 TapDragOccurs when one of several stylus gestures are detected, for example, Tap or Drag.

PreviewStylusUp PreviewStylusUp PreviewStylusUp PreviewStylusUp

手寫筆在這個項目上方且離開數位板時發生。Occurs when the stylus is raised off the digitizer while over this element.

PreviewTextInput PreviewTextInput PreviewTextInput PreviewTextInput

此元素以一種與裝置無關的方式取得文字時發生。Occurs when this element gets text in a device-independent manner.

StylusButtonDown StylusButtonDown StylusButtonDown StylusButtonDown

當手寫筆位於這個項目上方而使用者按下手寫筆按鈕時發生。Occurs when the stylus button is pressed while the stylus is over this element.

StylusButtonUp StylusButtonUp StylusButtonUp StylusButtonUp

當手寫筆位於這個項目上方而使用者放開手寫筆按鈕時發生。Occurs when the stylus button is released while the stylus is over this element.

StylusDown StylusDown StylusDown StylusDown

手寫筆在此項目上方且碰觸數位板時發生。Occurs when the stylus touches the digitizer while over this element.

StylusEnter StylusEnter StylusEnter StylusEnter

手寫筆游標進入元素的邊界時發生。Occurs when the stylus cursor enters the bounds of the element.

StylusInAirMove StylusInAirMove StylusInAirMove StylusInAirMove

手寫筆在項目上方移動,但沒有碰觸數位板時發生。Occurs when the stylus moves over an element, but without touching the digitizer.

StylusInRange StylusInRange StylusInRange StylusInRange

手寫筆靠近數位板而被偵測到時發生。Occurs when the stylus is close enough to the digitizer to be detected.

StylusLeave StylusLeave StylusLeave StylusLeave

手寫筆游標離開元素的邊界時發生。Occurs when the stylus cursor leaves the bounds of the element.

StylusMove StylusMove StylusMove StylusMove

手寫筆游標在元素上方移動時發生。Occurs when the stylus cursor moves over the element.

StylusOutOfRange StylusOutOfRange StylusOutOfRange StylusOutOfRange

手寫筆遠離數位板而無法被偵測到時發生。Occurs when the stylus is too far from the digitizer to be detected.

StylusSystemGesture StylusSystemGesture StylusSystemGesture StylusSystemGesture

在偵測到其中一個手寫筆筆勢時發生,例如 TapDragOccurs when one of several stylus gestures are detected, for example, Tap or Drag.

StylusUp StylusUp StylusUp StylusUp

手寫筆在這個項目上方且離開數位板時發生。Occurs when the stylus is raised off the digitizer while over this element.

TextInput TextInput TextInput TextInput

此元素以一種與裝置無關的方式取得文字時發生。Occurs when this element gets text in a device-independent manner.

適用於

另請參閱