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

Command prompt result in label. Python 2.7 -

javascript - How do I use URL parameters to change link href on page? -

amazon web services - AWS Route53 Trying To Get Site To Resolve To www -