Catching Esc & Enter in an Edit Field?
Hi,
I'm playing with a Form view document and need to handle the Esc & Enter
keys, but how? I tried OnKeyDown in the view but it never gets called.
Basically, I would like the Esc key to clear the edit field and the Enter
key to 'accept' the data typed then clear the edit field so I can enter more
in that field.
Thanks,
Paul
Re: Catching Esc & Enter in an Edit Field?
Paul Fredlein wrote:[color=blue]
> Basically, I would like the Esc key to clear the edit field and the Enter
> key to 'accept' the data typed[/color]
The problem is that <ESC> and <ENTER> will activate the Cancel and
Default buttons on your form. The edit control won't get any
notification. Try subclassing the edit control and handling the
WM_KEYDOWN message.
Re: Catching Esc & Enter in an Edit Field?
If you are inside a dialog box, then IsDialogMessage will pick
off the keys before they reach the edit control. You need to
subclass and return DLGC_WANTMESSAGE if the message is WM_KEYDOWN
and the wParam is VK_ESC or VK_RETURN.
On 29 Oct 2003 06:40:18 -0800, [email]johnbrown105@hotmail.com[/email] (John
Brown) wrote:[color=blue]
>The problem is that <ESC> and <ENTER> will activate the Cancel and
>Default buttons on your form. The edit control won't get any
>notification. Try subclassing the edit control and handling the
>WM_KEYDOWN message.[/color]