Sometimes when designing a form, there is a need to trigger the finishing of the form without requiring the use of the Finish button incorporated into the standard client applications.  There are multiple options available to allow this.

 

A hotspot can be added to the form and configured to trigger the form finishing functionality.  After adding a hotspot to the form, open the properties dialog for the hotspot and set the Type to Finish:

 

 

When the hotspot is clicked, the form will be finished.

 

Another option is to trigger the finishing of the form directly from within script code.  This can be done from the VB.NET script code and the JavaScript code. 

 

To trigger the form to finish from your VB Script code, you would use the line shown here:

 

Me.FinishFormFromScript = True

 

To trigger the form to finish from your JavaScript code, you would use the line shown here:

 

_form.finishForm();

 

When either of these script lines is executed, the form will be finished.