Notice that DIALOG_EVENT Help says nothing about the little "X" in the upper right hand corner of the dialog.OnEvent Help wrote:DIALOG_EVENT
EventParm is the dialog name. ExtraParm is a modal result value to detect. This could be the modal result of a button or menu option. So when that button is pressed the subroutine is triggered.
Even though GetDialogAction>DialogName,result will set the result variable to "2" when the named dialog upper right "X" is clicked, this is not the case with Onevent>DIALOG_EVENT...
If you have an OnEvent setup something like this:
Code: Select all
Onevent>DIALOG_EVENT,DialogName,2,Close
SRT>Close
Exit>0
END>Close
If you run the following script and pick the upper right hand "X", the dialog will close but the script will not close. If you instead pick the button which has a return value "2", the dialog and script both close.
Code: Select all
OnEvent>DIALOG_EVENT,Dialog1,2,Close
SRT>Close
Exit>0
END>Close
Dialog>Dialog1
Caption=Dialog1
Width=445
Height=250
Top=181
Left=CENTER
Max=0
Min=0
Resize=0
Button=Cancel,171,186,75,25,2
EndDialog>Dialog1
Dialog>Dialog3
Caption=Dialog3
Width=229
Height=74
Top=181
Left=CENTER
Max=0
Min=0
Close=0
Resize=0
EndDialog>Dialog3
Show>dialog1
Show>dialog3
Label>Loop
Wait>0.01
Goto>Loop
Hope this is helpful,
Dick