Search Forum
(53671 Postings)
Search Site/Articles

Archived Articles
712 Articles

C# Books
C# Consultants
What Is C#?
Download Compiler
Code Archive
Archived Articles
Advertise
Contribute
C# Jobs
Beginners Tutorial
C# Contractors
C# Consulting
Links
C# Manual
Contact Us
Legal

GoDiagram for .NET from Northwoods Software www.nwoods.com


 
Printable Version

OnIdle Event Handler
By David Jones

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-critical activities when the application goes into idle by creating it's own OnIdle Event 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 items dependant on whether any child windows are open. Also, it reviews the status of 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 this example.

Download OnIdleExample.zip