button click every interval c# -


i have button want click every 5 seconds.

i have button first button stop clicking.

this code far have

private void startbutton_click(object sender, eventargs e) {   timer1.enabled = true; }  private void timer1_tick(object sender, eventargs e) {         timer timer = new timer { interval = 5000 };         timer.start(); } 

how go on achieving this?

if button set timer start/stop called 'controlbutton', , 1 called 'dojobbutton'. setup timer interval = 5000 code. , in's tick event have code only

dojobbutton.performclick(); 

this trigger dojobbutton button's click action.
, set timer enable/disable in controlbutton's click event.
think enough goal.


Comments

Popular posts from this blog

node.js - Node js - Trying to send POST request, but it is not loading javascript content -

javascript - Replicate keyboard event with html button -

javascript - Web audio api 5.1 surround example not working in firefox -