Timer Confusion

1

180Reef

I am new to using timers and am not sure which timer is best used for
the timer driven vb program described below. Also, if I should use one
master timer or a timer for each button (system resource load).
Examples are welcome as I'm sure I'll have problems starting the code
for this (primarily write vbscript and rarely vb).

Timers: System.Windows.Forms.Timer, System.Timers.Timer, or
System.Threading.Timer?

Visualize the form as a checkerboard and each square on the form is a
button. Any one of the buttons should be able to start (and display) a
countdown, say 15 minutes to zero, based on an event trigger. Each
button can start and display a countdown at any time independent of the
other buttons. When a button is clicked the countdown stops. The
program will need to process other functions aside from the timers so I
am also concerned with program events that may interrupt the timers
countdown display on each button.

I was thinking System.Timers.Timer would be best because the timers
will run in their own thread other than the programs UI. Also, due to
the large number of button controls and multiple independent
countdowns.

Examples or links to similar code would be very helpful.

Thank you for your help.
 
G

Guest

I am new to using timers and am not sure which timer is best used for
the timer driven vb program described below. Also, if I should use one
master timer or a timer for each button (system resource load).
Examples are welcome as I'm sure I'll have problems starting the code
for this (primarily write vbscript and rarely vb).

Timers: System.Windows.Forms.Timer, System.Timers.Timer, or
System.Threading.Timer?

Visualize the form as a checkerboard and each square on the form is a
button. Any one of the buttons should be able to start (and display) a
countdown, say 15 minutes to zero, based on an event trigger. Each
button can start and display a countdown at any time independent of the
other buttons. When a button is clicked the countdown stops. The
program will need to process other functions aside from the timers so I
am also concerned with program events that may interrupt the timers
countdown display on each button.

I was thinking System.Timers.Timer would be best because the timers
will run in their own thread other than the programs UI. Also, due to
the large number of button controls and multiple independent
countdowns.

Examples or links to similar code would be very helpful.

Thank you for your help.

If you just have each button remember it's start/stop time then you only
need one timer. Each second, refresh every button's display.

Chris
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top