有没有可能看到项目键盘焦点属于哪个对象?抓不到。
提前感谢您的任何提示。
答案 0 :(得分:0)
使用 FocusManager.GetFocusedElement
返回到自然选择的控件。
Control focusedControl = (Control)FocusManager.GetFocusedElement(this);
使用 Keyboard.FocusedElement
控制键盘选择。
Control focusedControl = (Control)Keyboard.FocusedElement;
两者都返回 IInputElement
可以转换为 control
。