public void OnTickTrueAnsverLose(object sender, EventArgs e) { nowTimeTrueAnsverLose += 1; if (Ansver_A.Text.Contains(Ansver)) { ClicNow2 = Ansver_A; if (Ansver_A.BackColor == Color.Black) { Ansver_A.BackColor = Color.Green; } else { Ansver_A.BackColor = Color.Black; } } else if (Ansver_B.Text.Contains(Ansver)) { ClicNow2 = Ansver_B; if (Ansver_B.BackColor == Color.Black) { Ansver_B.BackColor = Color.Green; } else { Ansver_B.BackColor = Color.Black; } } else if (Ansver_D.Text.Contains(Ansver)) { ClicNow2 = Ansver_D; if (Ansver_D.BackColor == Color.Black) { Ansver_D.BackColor = Color.Green; } else { Ansver_D.BackColor = Color.Black; } } else if (Ansver_C.Text.Contains(Ansver)) { ClicNow2 = Ansver_C; if (Ansver_C.BackColor == Color.Black) { Ansver_C.BackColor = Color.Green; } else { Ansver_C.BackColor = Color.Black; } } if (nowTimeTrueAnsverLose >= endTimeTrueAnsverLose) { ClicNow2.BackColor = Color.Black; TimeTrueAnsverLose.Stop(); } }
//////////////////////////////////////////////////////////////// private void LoseGame() { AnsverBoxPicture(true, "Ответ не верен!"); butColor = Color.Red; TimeWindow.Start(); TimeColor.Start(); LoseGameE?.Invoke(this, EventArgs.Empty); TimeTrueAnsverLose.Start(); player = new SoundPlayer("../../Resurses/sound/false.wav"); // player.SoundLocation = "../../sound.wav"; player.Play(); }