Public Class Form1
Private Sub btnhello_Click(sender As Object, e As EventArgs) Handles btnhello.Click
If MessageBox.Show("click anything", "error box", MessageBoxButtons.AbortRetryIgnore, MessageBoxIcon.Question) = Windows.Forms.DialogResult.Abort Then
MessageBox.Show("aborted")
ElseIf DialogResult.Retry Then
MessageBox.Show("retry done")
End If
End Sub
End Class
in the Else If i want to do when i click Retry button display retry done
>Solution :
You can use a Select…Case Statement to handle the different DialogResult values MessageBox.Show can return:
Select Case MessageBox.Show("click anything", "error box", MessageBoxButtons.AbortRetryIgnore, MessageBoxIcon.Question)
Case DialogResult.Abort
MessageBox.Show("aborted")
Case DialogResult.Retry
MessageBox.Show("retry done")
Case DialogResult.Ignore
MessageBox.Show("ignore")
End Select