Use the basic If
statement to check the return value of MsgBox
. The MsgBox
doesn't cancel anything by itself.
If MsgBox("Prompt", MsgBoxStyle.YesNoCancel, "Title") = MsgBoxResult.Yes Then
' execute command
End If
You could also use MsgBoxStyle.YesNo
to get only the Yes and No buttons.