แก้ไข

แชร์ผ่าน


IInputElement Interface

Definition

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
Derived

Remarks

Important

Although this interface is public, it is not intended to be implemented in application or framework-building scenarios. This interface is public because of the inheritance requirements for connecting the WPF core to the WPF framework. 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. For more information, see WPF Architecture and also see Base Elements Overview.

Properties

Focusable

Gets or sets a value that indicates whether focus can be set to this element.

IsEnabled

Gets a value that indicates whether this element is enabled in the user interface (UI).

IsKeyboardFocused

Gets a value that indicates whether this element has keyboard focus.

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

Gets a value that indicates whether the mouse is captured to this element.

IsMouseDirectlyOver

Gets a value that indicates whether the mouse pointer is over this element in the strictest hit testing sense.

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

Gets a value that indicates whether the stylus is captured to this element.

IsStylusDirectlyOver

Gets a value that indicates whether the stylus is over this element in the strictest hit testing sense.

IsStylusOver

Gets a value that indicates whether the stylus is located over this element (or over visual child elements that are inside its bounds).

Methods

AddHandler(RoutedEvent, Delegate)

Adds a routed event handler for a specific routed event to an element.

CaptureMouse()

Attempts to force capture of the mouse to this element.

CaptureStylus()

Attempts to force capture of the stylus to this element.

Focus()

Attempts to focus the keyboard on this element.

RaiseEvent(RoutedEventArgs)

Raises the routed event that is specified by the RoutedEvent property within the provided RoutedEventArgs.

ReleaseMouseCapture()

Releases the mouse capture, if this element holds the capture.

ReleaseStylusCapture()

Releases the stylus capture, if this element holds the capture.

RemoveHandler(RoutedEvent, Delegate)

Removes all instances of the specified routed event handler from this element.

Events

GotKeyboardFocus

Occurs when the keyboard is focused on this element.

GotMouseCapture

Occurs when the element captures the mouse.

GotStylusCapture

Occurs when the element captures the stylus.

KeyDown

Occurs when a key is pressed while the keyboard is focused on this element.

KeyUp

Occurs when a key is released while the keyboard is focused on this element.

LostKeyboardFocus

Occurs when the keyboard is no longer focused on this element.

LostMouseCapture

Occurs when this element loses mouse capture.

LostStylusCapture

Occurs when this element loses stylus capture.

MouseEnter

Occurs when the mouse pointer enters the bounds of this element.

MouseLeave

Occurs when the mouse pointer leaves the bounds of this element.

MouseLeftButtonDown

Occurs when the left mouse button is pressed while the mouse pointer is over the element.

MouseLeftButtonUp

Occurs when the left mouse button is released while the mouse pointer is over the element.

MouseMove

Occurs when the mouse pointer moves while the mouse pointer is over the element.

MouseRightButtonDown

Occurs when the right mouse button is pressed while the mouse pointer is over the element.

MouseRightButtonUp

Occurs when the right mouse button is released while the mouse pointer is over the element.

MouseWheel

Occurs when the mouse wheel moves while the mouse pointer is over this element.

PreviewGotKeyboardFocus

Occurs when the keyboard is focused on this element.

PreviewKeyDown

Occurs when a key is pressed while the keyboard is focused on this element.

PreviewKeyUp

Occurs when a key is released while the keyboard is focused on this element.

PreviewLostKeyboardFocus

Occurs when the keyboard is no longer focused on this element.

PreviewMouseLeftButtonDown

Occurs when the left mouse button is pressed while the mouse pointer is over the element.

PreviewMouseLeftButtonUp

Occurs when the left mouse button is released while the mouse pointer is over the element.

PreviewMouseMove

Occurs when the mouse pointer moves while the mouse pointer is over the element.

PreviewMouseRightButtonDown

Occurs when the right mouse button is pressed while the mouse pointer is over the element.

PreviewMouseRightButtonUp

Occurs when the right mouse button is released while the mouse pointer is over the element.

PreviewMouseWheel

Occurs when the mouse wheel moves while the mouse pointer is over this element.

PreviewStylusButtonDown

Occurs when the stylus button is pressed down while the stylus is over this element.

PreviewStylusButtonUp

Occurs when the stylus button is released while the stylus is over this element.

PreviewStylusDown

Occurs when the stylus touches the digitizer while over this element.

PreviewStylusInAirMove

Occurs when the stylus moves over an element, but without touching the digitizer.

PreviewStylusInRange

Occurs when the stylus is close enough to the digitizer to be detected.

PreviewStylusMove

Occurs when the stylus moves while the stylus is over the element.

PreviewStylusOutOfRange

Occurs when the stylus is too far from the digitizer to be detected.

PreviewStylusSystemGesture

Occurs when one of several stylus gestures are detected, for example, Tap or Drag.

PreviewStylusUp

Occurs when the stylus is raised off the digitizer while over this element.

PreviewTextInput

Occurs when this element gets text in a device-independent manner.

StylusButtonDown

Occurs when the stylus button is pressed while the stylus is over this element.

StylusButtonUp

Occurs when the stylus button is released while the stylus is over this element.

StylusDown

Occurs when the stylus touches the digitizer while over this element.

StylusEnter

Occurs when the stylus cursor enters the bounds of the element.

StylusInAirMove

Occurs when the stylus moves over an element, but without touching the digitizer.

StylusInRange

Occurs when the stylus is close enough to the digitizer to be detected.

StylusLeave

Occurs when the stylus cursor leaves the bounds of the element.

StylusMove

Occurs when the stylus cursor moves over the element.

StylusOutOfRange

Occurs when the stylus is too far from the digitizer to be detected.

StylusSystemGesture

Occurs when one of several stylus gestures are detected, for example, Tap or Drag.

StylusUp

Occurs when the stylus is raised off the digitizer while over this element.

TextInput

Occurs when this element gets text in a device-independent manner.

Applies to

See also