Board index » delphi » Canceling key in KeyDown event

Canceling key in KeyDown event

Hi

I've written code on the KeyDown event of a TMemo to react when you
press Ctrl-Enter, now how to I cancel the enter, so it doesn't still do
a newline in the memo?  I tried Key := 0, but that did nothing, so why
is key declared as VAR in the param.

Renier

-----------------------------------------------------------------
Renier Crause                sMail: Jakarandapark 45
                                    1911  VANDERBIJLPARK
eMail:  att...@iscrovdb.co.za       South-Africa
-----------------------------------------------------------------

 

Re:Canceling key in KeyDown event


On Mon, 15 Apr 1996 13:04:35 -0200, Renier Crause

Quote
<att...@iscorvdb.co.za> wrote:
>Hi

>I've written code on the KeyDown event of a TMemo to react when you
>press Ctrl-Enter, now how to I cancel the enter, so it doesn't still do
>a newline in the memo?  I tried Key := 0, but that did nothing, so why
>is key declared as VAR in the param.

You might want to try ABORT after you have done your own code.  Just
remember only Abort if your Ctrl-Enter key is hit.

This may work I have not tried it so good luck.

Regards
   Glen

Other Threads