private void btnNext_Click(object sender, EventArgs e) { //Save Answer SaveAnswer(); sAnswer = ""; if (btnNext.Text == "Finish") { //this is the end of the survey. frmThankYou frmFinish = new frmThankYou(); frmFinish.Show(); this.Close(); } else { //Prompt for Next Question iCurrentQuestion++; btnBack.Visible = true; if (iCurrentQuestion == tQuestionAnswer.Rows.Count) { btnNext.Text = "Finish"; } else if (iCurrentQuestion > tQuestionAnswer.Rows.Count) { iCurrentQuestion = tQuestionAnswer.Rows.Count; } ShowQuestion(); } }