Restarting code when user clicks message dialogue "ok" button
<p>I am trying to spice up my code for a simple number guessing game I am making.  Once the user guesses the proper number a message dialogue box pops up telling him he is a winner.  That message dialogue box has one button named "ok" when I click it I am taken back to the form.</p>

<p>Instead I would like it to restart the code so that a new random number is generated.  Is this possible or do I need to manually revert the code back to its default state within the winner code area?</p>

<p>Here is my code now:</p>

<pre><code>    private void btnEval_Click (object sender, EventArgs e)
    {
        // increment the counter to be displayed later
        howManyClicks++;



        // main decision conditions, ensures something is entered
        if (txtNum.Text != "")
        {
            // user input number
            double num = double.Parse (txtNum.Text);

            if (randomNumber &gt; num)
            {
                // if too low
                this.BackColor = Color.Yellow;
                lblMain.Text = "TOO LOW!";
                lblReq.Text = "please try again";
                txtNum.Clear ();
                txtNum.Focus ();

            }
            else if (randomNumber &lt; num)
            {
                // if too high
                this.BackColor = Color.Red;
                lblMain.Text = "TOO HIGH!";
                lblReq.Text = "please try again";
                txtNum.Clear ();
                txtNum.Focus ();
            }
            else
            {
                // correct
                this.BackColor = Color.Green;
                lblMain.Text = "CORRECT!";
                lblReq.Text = "well done";
                MessageBox.Show ("You are right!! It took you " + howManyClicks + " guesses", "You are a WINNER!!",
                    MessageBoxButtons.OK, MessageBoxIcon.Exclamation, MessageBoxDefaultButton.Button1);
                txtNum.Clear ();
                txtNum.Focus ();
            }
        }
        else
        {
            MessageBox.Show ("You must enter a vaild number! Please try again.", "ERROR",
                MessageBoxButtons.OK, MessageBoxIcon.Error, MessageBoxDefaultButton.Button1);
            txtNum.Clear ();
            txtNum.Focus ();
        }
</code></pre>
