Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

How to hide Ctrl-Del in all DBGrids?

Posted on 1998-05-22
1
Medium Priority
?
237 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 3

Accepted Solution

by:
d4jaj1 earned 150 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

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
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…
This is my first video review of Microsoft Bookings, I will be doing a part two with a bit more information, but wanted to get this out to you folks.
How to fix incompatible JVM issue while installing Eclipse While installing Eclipse in windows, got one error like above and unable to proceed with the installation. This video describes how to successfully install Eclipse. How to solve incompa…
Suggested Courses

705 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