Tabe
08-31-2003, 06:18 PM
I have the following code in an "Exit" menu event and the form_queryunload event. The problem that arises is that the program forces me to answer "Yes" twice to actually exit the program instead of once, whether I select the "Exit" menu option or use the "X" button to close my game.
Note: I wasn't sure on what the parameters for Form_QueryUnload actually do, so had to guess on those values :)
Private Sub mnuGameExit_Click()
Call Form_QueryUnload(0, 0)
End Sub
Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Integer)
Dim i As Integer
i = MsgBox("Are you sure you want to exit?", vbYesNoCancel, "Exit Game?")
If i = vbYes Then
UpdateSettings
Unload Me
End
Else:
Cancel = 1
End If
End Sub
Any help would be greatly appreciated!
Thanks,
Tabe
www.tabe.nu
Note: I wasn't sure on what the parameters for Form_QueryUnload actually do, so had to guess on those values :)
Private Sub mnuGameExit_Click()
Call Form_QueryUnload(0, 0)
End Sub
Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Integer)
Dim i As Integer
i = MsgBox("Are you sure you want to exit?", vbYesNoCancel, "Exit Game?")
If i = vbYes Then
UpdateSettings
Unload Me
End
Else:
Cancel = 1
End If
End Sub
Any help would be greatly appreciated!
Thanks,
Tabe
www.tabe.nu