private void TargetText_TextChanged(object sender, EventArgs e) { if (!typingStarted) { TypingTimer.Start(); typingStarted = true; } if (TextsAreIdentical()) { AllowTyping(); TypingProgress.Value = TargetText.Text.Length; if (TargetText.Text.Length == SourceText.Text.Length) { TypingOver(); } } else { BlockTyping(); } UpdateCurrentCPM(); }
private void TypingOver() { TypingTimer.Stop(); TargetText.Enabled = false; MessageBox.Show("Time is up! Your result is " + CalculateCPM()); }