Catching Esc & Enter in an Edit Field? - Programmer

This is a discussion on Catching Esc & Enter in an Edit Field? - Programmer ; 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 ...

+ Reply to Thread
Results 1 to 3 of 3

Thread: Catching Esc & Enter in an Edit Field?

  1. 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



  2. Re: Catching Esc & Enter in an Edit Field?

    Paul Fredlein wrote:
    > Basically, I would like the Esc key to clear the edit field and the Enter
    > key to 'accept' the data typed


    The problem is that and 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.

  3. 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, johnbrown105@hotmail.com (John
    Brown) wrote:
    >The problem is that and 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.



+ Reply to Thread