开发者

WPF Full screen focus issue?

开发者 https://www.devze.com 2023-04-08 12:08 出处:网络
I\'ve a bit of an issue with a WPF application I recently 开发者_运维知识库wrote, which I\'m hoping is something trivial

I've a bit of an issue with a WPF application I recently 开发者_运维知识库wrote, which I'm hoping is something trivial but I can't figure out an appropriate way to debug.

My WPF application is a full screen application, that hides the mouse and is intended to be driven via the keyboard and as far as I'm aware is the only application running on the machine (it's placed in the Startup folder on a windows machine). The application itself is a clock/stopwatch style application for talks so recieves input at fairly infrequent intervals.

The problem that has been found, is that after a period of inactivity the application stops responding to keyboard input and requires a click of the mouse to start working again, almost as though it has lost focus. I believe all the power settings are turned off on the machine, but I'd be grateful if anyone could think of anything else that might be causing the problem, or if there's a way I can ensure the application never loses focus. Any Ideas?


You could trying wiring up an event handler in the FocusLost event to set Focus back on the Window

0

精彩评论

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

关注公众号