Hello, I have created a timer for my Winforms to tick down from 300 to 0 and then refresh my form. I have used this.refresh when it hits 0 but it doesn't seem to do anything as the label is still the same when it has completed it's timer function. Any ideas how to get it to work?
// Start the timer.
timeLeft = 300;
timer1.Start();
private void timer1_Tick(object sender, EventArgs e)
{
if (timeLeft > 0)
{
timeLeft = timeLeft - 1;
lblTime.Text = timeLeft + " seconds";
}
else if (timeLeft == 0)
{
//Timer runs out of time and refresh form
RefreshDirSize1();
RefreshDirSize2();
RefreshDirSize3();
RefreshDirSize4();
this.Refresh();
}