D
Daniel P.
I'm trying to set a timer that gets called every 3 seconds so I can update a
field in the UI with the time elapsed since the process started.
What am I doing wrong that timerDF_Tick does not get called?
private System.Windows.Forms.Timer timerDF;
this.timerDF = new System.Windows.Forms.Timer(this.components);
this.timerDF.Interval = 3000;
this.timerDF.Tick += new System.EventHandler(this.timerDF_Tick);
timerDF.Enabled = true;
timerDF.Start();
// here I call a stored procedure that takes about 10 minutes to run
......
private void timerDF_Tick(object sender, System.EventArgs e)
{
DateTime dt2 = DateTime.Now;
TimeSpan diff = dt2 - dt1 ;
textProcessTime.Text = string.Format( "{0}:{1}:{2}",
diff.Hours.ToString("00"),
diff.Minutes.ToString("00"),
diff.Seconds.ToString("00") );
textProcessTime.Update();
this.Update();
}
field in the UI with the time elapsed since the process started.
What am I doing wrong that timerDF_Tick does not get called?
private System.Windows.Forms.Timer timerDF;
this.timerDF = new System.Windows.Forms.Timer(this.components);
this.timerDF.Interval = 3000;
this.timerDF.Tick += new System.EventHandler(this.timerDF_Tick);
timerDF.Enabled = true;
timerDF.Start();
// here I call a stored procedure that takes about 10 minutes to run
......
private void timerDF_Tick(object sender, System.EventArgs e)
{
DateTime dt2 = DateTime.Now;
TimeSpan diff = dt2 - dt1 ;
textProcessTime.Text = string.Format( "{0}:{1}:{2}",
diff.Hours.ToString("00"),
diff.Minutes.ToString("00"),
diff.Seconds.ToString("00") );
textProcessTime.Update();
this.Update();
}