开发者

Is there a way to set Keyboard.FocusedElement to a specific element?

开发者 https://www.devze.com 2023-03-24 19:27 出处:网络
Keyboard.FocusedEle开发者_运维问答ment gives the element that has keyboard focus. However it has no setter. I want to set this property to another element through code. is there a way?

Keyboard.FocusedEle开发者_运维问答ment gives the element that has keyboard focus. However it has no setter. I want to set this property to another element through code. is there a way?

On microsoft's site, it said this: "Keyboard focus refers to the object that is receiving keyboard input. The element with keyboard focus has IsKeyboardFocused set to true."

However IsKeyboardFocused also has no setter as well.


I think you are just looking for the UIElement.Focus() method.

0

精彩评论

暂无评论...
验证码 换一张
取 消