Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有一个 wpf 应用程序。我需要处理主窗口的 key_down 事件。如果文本框元素获得焦点,则不会触发窗口的 key_down 事件。但是 key_up 事件可以正常工作(分别触发文本框和窗口的事件)。我怎样才能做到这一点?
试试 Preview_Key_Down...(我想这就是它的名字)。
我不是 WPF 编码员,但我认为您需要阅读有关事件隧道的信息...