>THe "X" in the upper-right corner calls the QueryUnload event. You can add
>code there to do anything you want. I'm not sure about ESC, but you can always
>put a check on ESC in the form keypress code.
Easiest way I can think of to get ESC is to put in a Quit button with its Cancel property set to .T.