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
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?
AppClose closes the main form.
This is the right code:
B4X:
Sub Exxit_Click 'exxit is a workaround for the exit menuitem
AppClose
End Sub
Sub Main_Close
If inplay=true then
if msgbox("Do you really wish to Exit?", "Exit Pairs v2.0", cMsgboxYesNo, cMsgboxQuestion) = cNo then
Main.CancelClose
End If
End If
End Sub
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?