Keyboard.AddPreviewKeyDownHandler(DependencyObject, KeyEventHandler) 方法

定义

PreviewKeyDown 附加事件添加处理程序。

public:
 static void AddPreviewKeyDownHandler(System::Windows::DependencyObject ^ element, System::Windows::Input::KeyEventHandler ^ handler);
public static void AddPreviewKeyDownHandler (System.Windows.DependencyObject element, System.Windows.Input.KeyEventHandler handler);
static member AddPreviewKeyDownHandler : System.Windows.DependencyObject * System.Windows.Input.KeyEventHandler -> unit
Public Shared Sub AddPreviewKeyDownHandler (element As DependencyObject, handler As KeyEventHandler)

参数

element
DependencyObject

侦听此事件的 UIElementContentElement

handler
KeyEventHandler

要添加的事件处理程序。

注解

此方法提供附加属性访问器,用于代码访问和附加事件的 XAML 属性处理 Keyboard.PreviewKeyDown

适用于