private void OnTrainerStart(object sender, EventArgs e) { Console.WriteLine("On Trainer Started"); startTrainingButton.Text = StartButtonTexts.Started; startTrainingButton.Click -= StartTrainer; startTrainingButton.Click += ToggleTrainer; TimerTrainer.Start(); TimerBeatPerMinute.Start(); groupBox1.Enabled = true; groupBox2.Enabled = false; }
private void ToggleTrainer(object sender, EventArgs e) { if (!TimerTrainer.Enabled) { startTrainingButton.Text = StartButtonTexts.Started; TimerTrainer.Start(); TimerBeatPerMinute.Start(); } else { startTrainingButton.Text = StartButtonTexts.Continue; TimerTrainer.Stop(); TimerBeatPerMinute.Stop(); } }