1. Home
  2. Computing & Technology
  3. Delphi Programming

Prevent CTRL+DELETE in DBGrid

By Zarko Gajic, About.com

If you need to disable keyboard delete operation inside a DBGrid you'll need to disable the CTRL+DELETE key press:

~~~~~~~~~~
procedure Form1.DBGrid1KeyDown
   (Sender: TObject; var Key: Word; Shift:TShiftState) ;
begin
   if (Shift = [ssCtrl]) and (Key = VK_DELETE) then
     Key := 0; {ignore}
end;
~~~~~~~~~~

Delphi tips navigator:
» Extract Icon and paint on Form
« How to convert an icon to a bitmap image

Zarko Gajic
Guide since 1998

Zarko Gajic
Delphi Programming Guide

Explore Delphi Programming
About.com Special Features

Stay connected and entertained with reviews on tips on the latest HDTVs, cellphones and more. More >

Easy ways to connect two computers for networking purposes. More >

  1. Home
  2. Computing & Technology
  3. Delphi Programming
  4. Coding Delphi Applications
  5. Delphi Tips and Tricks
  6. 1999 Delphi Tips
  7. Prevent CTRL+DELETE in DBGrid

©2009 About.com, a part of The New York Times Company.

All rights reserved.