Drunkalot wrote:
I wrote a program that made some combinations and add them to a listbox, and
i need to save the contents of the listbox every 1 minute...
The method that save the content of the listbox i have already wrote, but
i´m having problems making a timer to save that...
Hi Drunkalot,
does the Windows.Forms.Timer fit your needs?
private System.Windows.Forms.Timer timer1;
[...]
this.timer1.Interval = 60 * 1000;
this.timer1.Tick += new System.EventHandler(this.timer1_Tick);
[...]
private void timer1_Tick(object sender, System.EventArgs e)
{
SaveMyListBox();
}
System.Threading.Timer would be another possibility, perhaps better if
your timer has to tick *exactly* every 60 seconds. The
Windows.Forms-Timer is part of the UI-Message-Queue and may not tick if
your UI is blocked for any reason.
http://msdn.microsoft.com/library/?u...classtopic.asp
Cheers
Arne Janning