Why does pressing the Escape key cause changes on the form to be cancelled instead of just causing the form to close?
On forms based on the Form_Toolbar class and subclasses, pressing the Escape key causes the Click method of the toolbars Cancel button to be run. This is consistent with other types of forms where you use the Cancel property of a button to cause the buttons Click method to be run when the user presses the Escape key. The definition of the Cancel property of a commandbutton in the VFP help file reads: “Specifies whether a CommandButton or OLE Container control is the Cancel button; that is, if the user pressed the ESC key, the Cancel buttons Click event would occur.” The point being, that pressing the Escape key should cancel some process, not necessarily close the form. You can make the pressing of the Escape key do what ever you like by changing the code in the Activate event of the Form_Toolbar class in the VPMForms class library. Just change the ON KEY LABEL ESC command.