Solved

How to hide Ctrl-Del in all DBGrids?

Posted on 1998-05-22
1
234 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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering 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

Suggested Solutions

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…
Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
Established in 1997, Technology Architects has become one of the most reputable technology solutions companies in the country. TA have been providing businesses with cost effective state-of-the-art solutions and unparalleled service that is designed…
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

830 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