public void StopClock() { if (IsGameLoaded) { ClockTimer.Stop(); } }
private void ResetButton_Click(object sender, EventArgs e) { ClockTimer.Stop(); dsec = 0; sec = 0; min = 0; hou = 0; UpdateClockDisplay(); StartButton.Text = "Start"; }
private void ClockButton_Click(object sender, EventArgs e) { if (clockLabel.Text != "Off") { ClockTimer.Stop(); clockLabel.Text = "Off"; return; } ClockTimer.Interval = 1000; ClockTimer.Start(); clockLabel.Text = "On"; }
private async void ClockTimer_Tick(object sender, EventArgs e) { DateTime now = DateTime.UtcNow; if (now.Hour != clockHour && now.Minute == 0) { ClockTimer.Stop(); clockLabel.Text = "dingdong"; clockHour = now.Hour; await ClockRun(); clockLabel.Text = "On"; ClockTimer.Start(); } }
private void PauseButton_Click(object sender, EventArgs e) { ClockTimer.Stop(); StartButton.Text = "Resume"; }