OnIdle Event Handler


I developed this program recently as an exercise in porting some of my boilerplate Borland C++Builder code to C#. It specifically illustrates processing non-criticalactivities when the application goes into idle by creating it's own OnIdleEvent Handler and assigning it to the Application.Idle event as follows:
Application.Idle += new EventHandler(OnIdle);

It is used to perform enabling/disabling of the Window MDI menu itemsdependant on whether any child windows are open. Also, it reviews the statusof the CAPS, NUM and SCRL keys and displays the result in the status bar.This works even if there is a modal window open – the About Box in thisexample.

Download OnIdleExample.zip

Twitter Digg Delicious Stumbleupon Technorati Facebook Email

No comments yet... Be the first to leave a reply!