I want a code that when a user opens my program, a code start to do an action every 5 minutes. for example every 5 minutes a message alert comes on the screen.
And I want a code to stop this. For example when the user clicks on a button, this loop do not execute more.
Regards.
I want a code that when a user opens my program, a code start
Share
Like the others have mentioned, use a System.Windows.Forms.Timer if you are using WinForms. You’ll be able to drag a Timer from the toolbox to your form, then it appears below your form. Set the
Interval = 300000(5 * 60 * 1000 to covert to milliseconds), andEnabled = true