How to Catch the [X]

Cableguy

Expert
Licensed User
Longtime User
Hi,

I think I saw a post about this in the old forum, how can we catch the [X] press event?

I know this sounds stupid....heres my code..

Sub Exxit_Click 'exxit is a workaround for the exit menuitem
If inplay=true then
x = Msgbox ("Do you really wish to Exit?", "Exit Pairs v2.0", cMsgboxYesNo, cMsgboxQuestion)
If x=cyes then
AppClose
else
return
end if
else
AppClose
End if
End Sub

Sub Main_Close
Exxit_click
End Sub

What happens is that it seems to be a circular call(!?), What i'm trying to acomplish is that wether thru the "exit" menu item, wether thru the [X] button, the user is questioned if the "inplay" var is true.
What am I doing wrong?
 
Last edited:

Cableguy

Expert
Licensed User
Longtime User
I understand your code, but where is the error in my code, my logic is only in the wrong way, but still true isn't it?
As I understand Applose calls the form_close event/sub? and if not present it close the form...Wright?
 
Last edited:
Top