Solved

How to hide Ctrl-Del in all DBGrids?

Posted on 1998-05-22
1
226 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
Comment Utility
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

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

Suggested Solutions

Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

771 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

Need Help in Real-Time?

Connect with top rated Experts

8 Experts available now in Live!

Get 1:1 Help Now