1 Reply Latest reply on Aug 18, 2017 5:35 AM by .-.--.--

    How to leave a form under controlled conditions?

    delinquent

      I like to exit a form under controlled conditions, releasing licenes, exiting Variantmanager, etc.

      In the past I did it using a Sub that does it all, but that doesnt work if a user uses the the window "x"

      What is TheView.RunTerminat doing compared to TheView.Cancel

      When is TheView.EventTerminate called?

        • 1. Re: How to leave a form under controlled conditions?
          .-.--.--

          To answer this question, I created an IDE form with two buttons.  The first button runs TheView.Cancel when clicked, while the second button runs TheView.RunTerminate when clicked.  Then, in the Form Properties, TheView_EventTerminate runs MsgBox "I'm Done".

           

          With the form running, a click on the first button displays the message and closes the form (which is equivalent to clicking the "X" icon or the File > Close menu entry), while a click on the second button displays the message and leaves the form running.  And, if you run the form with the read-only switch off, the stop button will display the message and leave the form in edit mode.

           

          So, all of these actions perform TheView_EventTerminate, which you can use for cleanup conditions.  But, TheView.RunTerminate will not exit the form or stop it from running, while TheView.Cancel will exit.