title: Reinitialize variables back to starting status in VB
body: <p>I am attempting to ask the user if they would like to play the game again by way of a procedure. If the user selects <code>Yes</code> all variables are then set back to starting status and if they select <code>No</code>, they simply return to the form. The problem I am having is that I would prefer not to use the <code>Application.Restart()</code>, is there a way to initialize the program to start over without using the <code>Application.Restart()</code>?</p>
  
  <p>Code For Procedure:</p>
  
  <pre><code> 'This Procedure Disables Play Continuation, Asks User To Play Again, &amp; Initializes Starting Status
  Sub DisplayPlayAgain()
  
      'Disable Button That Allows User To Continue Play
      cmdGuess.Enabled = False
  
      'Display A Button Asking User To Play Again
      Dim answer As DialogResult
      MessageBox.Show("Would You Like To Play Again?", " Confirmation of Quit", MessageBoxButtons.YesNo)
      If answer = vbYes Then
  
          'Reset Variables back to Starting Status
          lstNumberGuess.Items.Clear()
          lblTotalCount.Text = String.Empty
          lblAnswer.Text = String.Empty
          txtUserGuess.Text = String.Empty
          lblAnswer.BackColor = Color.FromKnownColor(KnownColor.Control)
          shrtCounterTotal = 0
          shrtSecret = shrtRandom.Next(1, 100)
  
          'Set Focus Back to textbox
          txtUserGuess.Select()
  
          'Allow User to Play Again
          Application.Restart()
      Else
          'Or if No is selected, return to the form
      End If
  End Sub
  </code></pre>