Looking to have a button to exit the program with a message box popping up asking for confirmation to exit. Here's what I have so far that's not working as intended/don't know what to write for "no".
Private Sub btnExit_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnExit.Click
MsgBox("Are you sure you want to exit the program? All inputted information will be lost.", vbYesNo, "Exit")
If MsgBoxResult.Yes Then
Me.Close()
ElseIf MsgBoxResult.No Then
'Watisthisidonteven
End If
End Sub
Clicking "Yes" does close it, but also clicking "No" closes it as well, even if theres no code which I'm not sure why. The "Yes" button should close the program, and the "No" button should close the messagebox and show the program again.
XI Wiki


