I would like a subform to be closed
when the user presses the Escape key.
It would be great if someone had a solution
which does not use a "Close" button with
it's Cancel property set to true.
Thanks!
Arne.
Woody
Arne Alles <al...@hildesheim.sgh-net.de> wrote in message
news:7qj7g1$ck...@forums.borland.com...
James
>Hi all,
>
>I would like a subform to be closed
>when the user presses the Escape key.
>It would be great if someone had a solution
>which does not use a "Close" button with
>it's Cancel property set to true.
Have the form monitor all keystrokes by setting its KeyPreview
property to True. Then in the OnKeyPress event handler, check if the
key is Escape and call Close if it is.