Home > Archive > Programming with dBASE > July 2005 > Trapping the Delete Key









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Trapping the Delete Key
Jim Dutton

2005-07-06, 8:23 pm

I am working on a version of the seeker control. It is OK as long as the user just types in part of a name (the program searches a table for matching names). But I have to take into account the possibility that the user will press other keys. The backs
pace key is trapped successfully by the entryfield's onkey property, but the delete key is not. Does anyone know a way to trap the delete key?
Michael Nunn

2005-07-07, 8:24 pm

Jim Dutton asked:

> Does anyone know a way to trap the delete key?


One way would be to have onGotFocus and onLostFocus functions associated
with the entry field.

In function onGotFocus enter the line: 'On key label Del ? CHR(7)' //rings
the bell instead of deleting

In function onLostFocus enter the line 'On key'.//restores the status quo
(essential!)


Mike






Michael Nunn

2005-07-07, 8:24 pm

Don't know why, but my contribution started a separate thread - see 'Re:
Trapping the Delete Key'

Mike


"Jim Dutton" <jtdutton@bu.edu> wrote in message
news:e0kUhfmgFHA.1756@news-server...
>I am working on a version of the seeker control. It is OK as long as the
>user just types in part of a name (the program searches a table for
>matching names). But I have to take into account the possibility that the
>user will press other keys. The backspace key is trapped successfully by
>the entryfield's onkey property, but the delete key is not. Does anyone
>know a way to trap the delete key?



Jim Dutton

2005-07-07, 8:24 pm

Thanks for the insight.

Jim
===========
Michael Nunn Wrote:

> Jim Dutton asked:
>
>
> One way would be to have onGotFocus and onLostFocus functions associated
> with the entry field.
>
> In function onGotFocus enter the line: 'On key label Del ? CHR(7)' //rings
> the bell instead of deleting
>
> In function onLostFocus enter the line 'On key'.//restores the status quo
> (essential!)
>
>
> Mike
>
>
>
>
>
>


Michael Nunn

2005-07-07, 8:24 pm

My pleasure.


"Jim Dutton" <jtdutton@bu.edu> wrote in message
news:QrFUN7ygFHA.1796@news-server...
> Thanks for the insight.
>
> Jim
> ===========
> Michael Nunn Wrote:
>
>



Sponsored Links





Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive | Programming forum archive

Copyright 2008 droptable.com