using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Threading;
namespace ConsoleApplication5
{
class Program
{
System.Windows.Forms.Timer m_Timer = null;
int i = 0;
Program(int interval)
{
m_Timer = new System.Windows.Forms.Timer();
m_Timer.Tick += new EventHandler(HandleTimerTick);
m_Timer.Interval = interval;
m_Timer.Enabled = true;
}
static void Main(string[] args)
{
new Program(1000);
//new System.Windows.Forms.Form().ShowDialog();
//MessageBox.Show("Hi");
//new System.Windows.Forms.Form().ShowDialog();
//Console.ReadLine();
while (true)
{
System.Windows.Forms.Application.DoEvents();
Thread.Sleep(50);
}
}
private void HandleTimerTick(object sender, EventArgs e)
{
Console.WriteLine("{0}", ++i);
}
}
}