调试WPF时如何找出哪个元素获得焦点?
我正在使用键盘导航,但无法从视觉上找到哪个元素具有焦点。在调试时,我设法中断了窗口内方法的执行,但我不知道哪个属性将显示当前聚焦的控件。
I'm navigating with the keyboard, and I can't find visually which element has the focus. While debugging I managed to break the execution in a method inside the Window but I don't know which property will reveal the current focused control.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
使用 Snoop 并在事件选项卡中查找事件。从事件组合框中选择要侦听的所有事件。当您浏览应用程序时,您可以看到选项卡正在刷新,其中包含接收这些事件的新控件。
Use Snoop and look for the events in events tab. Select all the events you want to listen from the events combo box. As you move through your application you can see the tab refreshing with new controls that are receiving those events.