I\'m creating a WinForm application that takes a person\'s photo with a webcam and am trying to now create a countdown effect. I have 4 images that i would like to cycle thr
The Windows Timer class uses the message queue for notifying the timer has expired. And so you need to have the message loop running in order to get the correct number of timer expires occuring. So you should set the counter variable to be a class field and then you can increment it inside the event handler. Something like this...
// Main Code
_counter = 0;
tmCountDown.Start();
// Event Handler
private void tmCountDown_Tick(object sender, EventArgs e)
{
_counter++;
if (_counter == 4)
tmCountDown.Stop();
else
pbCountDown.Image = new Bitmap("c:/vrfid/apppics/" + _counter + ".jpg");
}