From e08e0e24e4d9712388bef680413ca693c7b9d71b Mon Sep 17 00:00:00 2001 From: EggMan20339 <99349302+EggMan20339@users.noreply.github.com> Date: Thu, 1 Feb 2024 20:19:13 -0500 Subject: [PATCH] done without smiley. added prompt for reset --- ElementaryMathematics/Form1.cs | 28 ++++++++++++++++++++-------- 1 file changed, 20 insertions(+), 8 deletions(-) diff --git a/ElementaryMathematics/Form1.cs b/ElementaryMathematics/Form1.cs index 8adb4ee..d04c7b0 100644 --- a/ElementaryMathematics/Form1.cs +++ b/ElementaryMathematics/Form1.cs @@ -327,16 +327,28 @@ namespace ElementaryMathematics private void btnReset_Click(object sender, EventArgs e) { - btnClear_Click(sender, e); - - numRunningCorrect = 0; - numRunningIncorrect = 0; - UpdateButtons(); - rdoAddition.Select(); + DialogResult btnDialog; + string strResponse; - lblNumCorrect.Text = "0"; - lblNumIncorrect.Text = "0"; + strResponse = "Do you really want to reset all statistics?"; + + btnDialog = MessageBox.Show(strResponse, "Chapter Four", MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button2); + + if (btnDialog == DialogResult.Yes) + { + btnClear_Click(sender, e); + + numRunningCorrect = 0; + numRunningIncorrect = 0; + + UpdateButtons(); + rdoAddition.Select(); + + lblNumCorrect.Text = "0"; + lblNumIncorrect.Text = "0"; + } + } private void UpdateButtons()