Global Timer i.e. A Timer which works on multiple forms. - C# -


i wondering if possible create timer isnt bound single form. im making quiz , want user have 2 minutes answer questions. once 2 minutes current form close , endscreen appear. time must visible @ times. great.

yes can use static class static dispatch timer.

public static class statictimer` {    public static dispatchertimer timer { get; set; } } 

in form use:

staticclass.timer = new dispatchertimer(); staticclass.timer.interval = new timespan(0, 0, 0, 0, 100); staticclass.timer.tick += timer_tick; staticclass.timer.start();   public void timer_tick(object sender, eventargs e)  {      logic....   } 

Comments

Popular posts from this blog

javascript - Knockout pushing observable and computed data to an observable array -

'hasOwnProperty' in javascript -

Trouble making a JSON string -