using System;
using System.Drawing;
using System.Windows.Forms;
class CloseInTen: Form
{
public CloseInTen()
{
this.Text = "Closing in Ten Seconds";
Timer timer = new Timer();
timer.Interval = 10 * 1000;
timer.Tick += new EventHandler(TimerOnTick);
timer.Enabled = true;
}
void TimerOnTick(object obj, EventArgs ea)
{
Timer timer = (Timer) obj; // get the sender Timer object
timer.Stop();
timer.Tick -= new EventHandler(TimerOnTick);
this.Close();
}
public static void Main()
{
Application.Run(new CloseInTen());
}
}