void timer1_Tick(object sender, EventArgs e) { //Checks if the progress bar is not equal to 20 then adds 1 to the progress bar if (progressBar1.Value != 20) { progressBar1.Value++; } else { //Stops The timer and displays a messagebox timer1.Stop(); MessageBox.Show("You ran out of time. Your Score is still: " + GlobalQuizValues.playerScoreDuringQuiz); //hides the form this.Hide(); //opens next form frmFinish mynextscreen = new frmFinish(); mynextscreen.ShowDialog(); //adds 0 to the score GlobalQuizValues.playerScoreDuringQuiz = GlobalQuizValues.playerScoreDuringQuiz += 0; //checks if the user has enabled speech and if true plays a message if (playerDetails.activesound == true) { string output = "That was the wrong Answer, your score is still" + GlobalQuizValues.playerScoreDuringQuiz; SoundMethodSpeech.speech(output); } } }
void timer1_Tick(object sender, EventArgs e) { if (progressBar1.Value != 10) { progressBar1.Value++; } else { timer1.Stop(); MessageBox.Show("You ran out of time. Your Score is still: " + GlobalQuizValues.playerScoreDuringQuiz); this.Hide(); frmFinish mynextscreen = new frmFinish(); mynextscreen.ShowDialog(); GlobalQuizValues.playerScoreDuringQuiz = GlobalQuizValues.playerScoreDuringQuiz += 0; if (playerDetails.activesound == true) { string output = "That was the wrong Answer, your score is still" + GlobalQuizValues.playerScoreDuringQuiz; SoundMethodSpeech.speech(output); } } }
void timer1_Tick(object sender, EventArgs e) { /*checks that if the progress bar is full it tells the user they have ran out of time and displays there current score * if the progress bar value is below the max value it adds 1 on to it*/ if (progressBar1.Value != 20) { progressBar1.Value++; } else { timer1.Stop(); MessageBox.Show("You ran out of time. Your Score is still: " + GlobalQuizValues.playerScoreDuringQuiz); this.Hide(); frmFinish mynextscreen = new frmFinish(); mynextscreen.ShowDialog(); GlobalQuizValues.playerScoreDuringQuiz = GlobalQuizValues.playerScoreDuringQuiz += 0; if (playerDetails.activesound == true) { string output = "That was the wrong Answer, your score is still" + GlobalQuizValues.playerScoreDuringQuiz; SoundMethodSpeech.speech(output); } } }