Share via


KeyboardDevice.Focus(IInputElement) 方法

定義

在指定的 IInputElement 上設定鍵盤焦點。

public:
 System::Windows::IInputElement ^ Focus(System::Windows::IInputElement ^ element);
public System.Windows.IInputElement Focus (System.Windows.IInputElement element);
[System.Security.SecurityCritical]
public System.Windows.IInputElement Focus (System.Windows.IInputElement element);
member this.Focus : System.Windows.IInputElement -> System.Windows.IInputElement
[<System.Security.SecurityCritical>]
member this.Focus : System.Windows.IInputElement -> System.Windows.IInputElement
Public Function Focus (element As IInputElement) As IInputElement

參數

element
IInputElement

要向其移動焦點的項目。

傳回

擁有鍵盤焦點的項目。

屬性

例外狀況

element 不是 UIElement 也不是 ContentElement

適用於