/// <summary> /// Clicking the Stop button /// </summary> private void Stop_Click(object sender, EventArgs e) { // stop the timer textBoxMusicProgram.Enabled = true; textBoxDelay.Enabled = true; TheTimer.Stop(); }
private void ToolStripButton2_Click(object sender, EventArgs e) { //TheTimer.Enabled = false; TheTimer.Stop(); IsRunning = false; propertyGrid1.Enabled = true; btnStart.Enabled = true; btnStop.Enabled = false; statusPanel.Text = "off"; }
private void TheTimer_Tick(object sender, EventArgs e) { try { _timeSpan = DateTime.Now - _past; toolPanelTime.Text = ElapsedTime = _timeSpan.Minutes.ToString() + ":" + _timeSpan.Seconds.ToString(); ///Запускает эмулицию продукции на производстве Simulation(); } catch (Exception ex) { TheTimer.Stop(); MessageBox.Show(ex.Message); //return; } }
private void Source_OnEmpty(object sender, EventArgs e) { TheTimer.Stop(); TheTimer.Enabled = false; IsRunning = false; MessageBox.Show("Источник пуст!"); Statisctics statisctics = new Statisctics() { Count = this.Count, CrashCount = this.CrashCount, ElapsedTime = this.ElapsedTime }; if (CreateStatisctics(statisctics)) { toolStripButtonStatisctics.Enabled = true; toolStripButtonStatisctics.Checked = true; btnStop.PerformClick(); statusPanel.Text = "complete"; } }
private void ToolStripButton4_Click(object sender, EventArgs e) { TheTimer.Stop(); IsRunning = false; btnStart.Enabled = true; }