WPF:创建你自己的屏幕保护程序,如果你运行的应用程序是“空闲” [英] WPF: Create your own screen-saver if your running application is 'idle'

查看:238
本文介绍了WPF:创建你自己的屏幕保护程序,如果你运行的应用程序是“空闲”的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有一种方法来创建一个窗口(类似于一个屏幕保护程序)一旦你运行的应用程序是不是交互(或闲置)的用户,意思是说,没有鼠标的动作发生在将显示该应用程序。

Is there a way to create a window (similar to a screen-saver) that will be displayed once your running application is not 'interacting' (or being idle) with the user, meaning to say, no mouse movements happening on the application.

我的一些朋友建议使用定时器为这一个。任何建议有一个良好的开端?谢谢你。

Some of my friends suggested to use a Timer for this one. Any suggestion for a good head start? Thanks.

推荐答案

如果您希望创建自己的屏幕保护程序建立另一种形式。从表单中删除边框。让它在最上面的,并开始最大化。然后你只画了控制,做任何你想要的。

If your looking to create your own screensaver just create another form. Remove the border from the form. Make it the top most and start maximized. Then you just paint the control to do whatever you want.

随后连线了的形式来检查,如果鼠标移动或按键是pressed。你需要创建一个计时器,将确定屏幕应该显示。

Then wire up the form to check if the mouse moves or a key is pressed. You'll need to create a timer that will determine if the screensaver should be shown.

这篇关于WPF:创建你自己的屏幕保护程序,如果你运行的应用程序是“空闲”的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆