In my program, you can quit from a menu and the program asks you to make sure:
But pressing the 'x' button just closes the app straight away, how do I catch when the user uses either?VB Code:
Private Sub mnuexit_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles mnuexit.Click If MsgBox("Are you sure you want to end the program?", vbYesNo, "Exit CodeBook") = 6 Then Application.Exit() End If End Sub
I know it has something to do with:but I can't get it to work correctly. Any help would be appreciated.VB Code:
Private Sub Form1_Closing(ByVal sender As Object, ByVal e As System.EventArgs) Handles MyBase.Closed End Sub




Reply With Quote