Click here to Skip to main content
15,891,136 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
I would like to loop a method in a timer and every 10 seconds the method would start.
any ideas?
Posted

Try:

C#
    ...
    Timer tim = new Timer();
    tim.Interval = 10000;
    tim.Tick += new EventHandler(tim_Tick);
    tim.Start();
    ...

void tim_Tick( object sender, EventArgs e )
    {
    ...
    }
 
Share this answer
 
Comments
Manfred Rudolf Bihy 3-Oct-11 9:39am    
What, no mention of google?

Still a 5!
Its very simple to do:

Choose in toolbox, timer object and set some property:

interval=10000 (ms)

enabled=true

and you can in Tick event, call your function!
 
Share this answer
 
Comments
Manfred Rudolf Bihy 3-Oct-11 9:40am    
That's how it's done! 5+
hzawary 3-Oct-11 9:51am    
I don't know! maybe he had beginner in this question!

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900