且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何检测我的应用程序在C#中处于空闲状态(包含表格)?

更新时间:2023-02-15 19:30:51

不需要将解决方案与计时器和鼠标事件结合在一起.只需处理Application.Idle事件.

Hacking together a solution with timers and mouse events is unnecessary. Just handle the Application.Idle event.

Application.Idle += Application_Idle;

private void Application_Idle(object sender, EventArgs e)
{
    //    The application is now idle.
}