Close ETO form and cancel script

Hi, I have an ETO form to input data to my script, however if I use the “Cancel” button the ETO form closes but the python script is still active and I have to use the “esc” button to close the script. So how do I close both on the ETO cancel button.

Please keep it simple as straight forward if possible.

    # Close button click handler
    def OnCloseButtonClick(self, sender, e):
        self.Close(False)

Hard to tell without any context, but the script may still waiting for or doing something even though the form is closed.

So within OnCloseButtonClick() you have to make sure the rest of the script will finish and return, even without getting the input data.

Hi,

Many thanks for the advice I will have to think about how I do that.