DZone Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world
OnApplicationIdle Event
using System;
using System.Threading;
using System.Reflection;
using System.Windows.Forms;
public class HelloWorldForm : Form
{
public HelloWorldForm()
{
Text = "Hello, WindowsForms!";
}
}
public class ApplicationEventHandlerClass
{
public void OnIdle(object sender, EventArgs e)
{
Console.WriteLine("The application is idle.");
}
}
public class MainClass
{
public static void Main()
{
HelloWorldForm FormObject = new HelloWorldForm();
ApplicationEventHandlerClass AppEvents = new ApplicationEventHandlerClass();
Application.Idle += new EventHandler(AppEvents.OnIdle);
Application.Run(FormObject);
}
}






Comments
Nando Quintana replied on Fri, 2007/02/16 - 7:47am