public void InitTimer()
{
timer1 = new Timer();
timer1.Tick += new EventHandler(timer1_Tick);
timer1.Interval = 200; // in milliseconds
timer1.Start();
}
private void timer1_Tick(object sender, EventArgs e)
{
MessageBox.Show("test");
}
Using that code from How can I raise an event every hour (or specific time interval each hour) in .NET?
I’m VERY new to C#, but I’m not sure what’s wrong. I’m trying to display a messagebox in this example every 2 seconds. There are no errors, the messagebox simply does not show.
You forgot to call the function in your load.