Delete key

D

David French

Is there any way the Delete key on the keyboard can be deactivated?
I know the icon "Delete" may be removed and even the entire Toolbar may be
made not available...but the Delete key on the keyboard is always there.

Any suggestions would be appreciated.

Dave French
 
A

Allen Browne

What are you trying to achieve, Dave?

While it is possible to set a form's KeyPreview property to Yes, and then
trap the Delete key in the form's KeyDown event and destroy it by setting
KeyCode to zero, there is probably a better solution.

For example, if you are trying to prevent the user deleting a record, you
could just cancel the form's Delete event. Easier still, just set the form's
Allow Deletions property to No.
 
Top