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 - Confirm a form & display message if form is valid with JQuery -

Retrieving ETA (estimated time of arrival) with Google Distance Matrix API and public transit as transport mode -

ionic framework - Meteor - Error: Failed to execute 'insertBefore' on 'Node' -