>There should be nothing else running during the print preview (a modal thing waiting for the user to close or print), and it's pressing escape there that flushes me straight out to the command window (from the IDE) or desktop (from the .exe).
>
>So your suggestion is to place code in the KeyPress event of the form to trap escapes there? Is there a KeyPress event associated with the print preview window. I'm previewing in a defined full-screen window rather than the default preview that always starts too small.
No, it is my understanding that SET ESCAPE OFF does not disable the ESC key - what it does is disable the interruption of an executing program, with the ESC key.
You should still be able to carry out some default actions with ESC, such as closing a BROWSE window, or a preview window.
What you have to program separately is the closing of a regular form with ESC. One way to do this is to have a "Cancel" button, with the corresponding property set.
Difference in opinions hath cost many millions of lives: for instance, whether flesh be bread, or bread be flesh; whether whistling be a vice or a virtue; whether it be better to kiss a post, or throw it into the fire... (from Gulliver's Travels)