I don't know if it will work, but you should ALWAYS have a way to do things with the mouse. Put a command button on the form and set it's cancel property to .T.
>Hi everybody,
>
>I have a form with Web Browser control taking all the form. I set KeyPreview property to .t. and added a code in KeyPress event
>
> if nKeyCode = 27
> thisform.release()
>endif
>
>However, pressing ESC doesn't close the form. Do you know how can I make this form to close on ESC?
>
>Thanks in advance.
Craig Berntson
MCSD, Microsoft .Net MVP, Grape City Community Influencer