title: How to get MessageBoxButtons.RetryCancel to do restart or exit program?
body: <p>How do i make MessageBoxButtons.RetryCancel to restart the program(for Retry) or exit the program(for Cancel)?  Here is my code:</p>
  
  <pre><code>Private Sub btnDisplay_Click(sender As Object, e As EventArgs) Handles btnDisplay.Click
      ' displays a student's grade
  
      Double.TryParse(txtEarned.Text, dblEarned)
  
      For Each minimum As Double In dblMinimumPoints
          If dblEarned &gt;= minimum Then
              lblGrade.Text = strGrade(gradeIndex)
              gradeIndex += 1
          End If
      Next
  
      txtEarned.ReadOnly = False
      btnDisplay.Enabled = False
  
      MessageBox.Show("Do you want to try again?", "Grade Calculator",
                      MessageBoxButtons.RetryCancel, MessageBoxIcon.Question)
  End Sub
  </code></pre>