以下は私が作成しているデスクトップタスクタイマーの経過時間タイマーとして使用しようとしているコードです。これが実行されるとすぐに60秒にカウントされ、リセットされて分に追加されることはありません。タイマーは60秒後にリセットされます
//tick timer that checks to see how long the agent has been sitting in the misc timer status, reminds them after 5 mintues to ensure correct status is used
private void statusTime_Tick(object sender, EventArgs e)
{
counter++;
//The timespan will handle the push from the elapsed time in seconds to the label so we can update the user
//This shouldn't require a background worker since it's a fairly small app and nothing is resource heavy
var timespan = TimeSpan.FromSeconds(actualTimer.Elapsed.Seconds);
//convert the time in seconds to the format requested by the user
displaycounter.Text=("Elapsed Time in " + statusName+" "+ timespan.ToString(@"mm\:ss"));
//pull the thread into updating the UI
Application.DoEvents();
}
あなたはタイマーが初期化された方法を共有することはできます? –