Disabling the ESC Key

Is there a way to disable the Esc key while a user has opened up a form? What we’re trying to do is force the user to click on the Cancel button instead of pushing the Esc key.

Yes, this is possible, set the option “Close Forms On Esc” in the client setup to “No”… Saludos Nils

Nils’ solution works universally on all forms. If you want this behaviour only on a specific form: 1. In the form declare a boolean variable i.e. CancelPushed 2. Set the Cancel property of the Cancelbutton to No 3. In the OnPush trigger of the Cancel button and Ok button: CancelPushed := TRUE; 4. In the OnQueryClose Trigger of the form: EXIT(CancelPushed);

Thanks! You guys are awesome!

Hi ,

Where can I find the Client setup


Tools → Options

Thank you Dave