Solved

How to hide Ctrl-Del in all DBGrids?

Posted on 1998-05-22
1
233 Views
Last Modified: 2010-04-06
Hi!
I don't want to delete my records from databases through
Ctrl-Del in DBGrid. How to hide Ctrl-Del in all DBGrids?

May be KeyPreview will help me?
0
Comment
Question by:hansmtbank
1 Comment
 
LVL 3

Accepted Solution

by:
d4jaj1 earned 50 total points
ID: 1347453
Put this in teh DBGrid's OnKeyDown event.

if ((Shift = [ssCtrl]) and (Key = VK_DELETE)) then
 begin
  key := 0;
  showmessage('Please use teh menu to delete records!);
 end;

You could put this code on the Form's OnKeyDown event, but I would suggest it.  each time teh user pressed a key (any key) it woudl have to check for this - which could slow your program down.  If your stuck on doing it this way, use ---  "and (ActiveControl is TDBGrid)"

Any questions, please add a comment.

Good Luck!  Jay
0

Featured Post

ScreenConnect 6.0 Free Trial

Discover new time-saving features in one game-changing release, ScreenConnect 6.0, based on partner feedback. New features include a redesigned UI, app configurations and chat acknowledgement to improve customer engagement!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Have you ever had your Delphi form/application just hanging while waiting for data to load? This is the article to read if you want to learn some things about adding threads for data loading in the background. First, I'll setup a general applica…
In my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
In a recent question (https://www.experts-exchange.com/questions/28997919/Pagination-in-Adobe-Acrobat.html) here at Experts Exchange, a member asked how to add page numbers to a PDF file using Adobe Acrobat XI Pro. This short video Micro Tutorial sh…
This video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.

803 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question