Solved

Disable copy/cut/past from Tedit

Posted on 1997-08-30
2
376 Views
Last Modified: 2012-05-04
hi
how can diable cut/copy/paste and even "color" text for such an operation on Tedit component ?
0
Comment
Question by:asi
[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
2 Comments
 
LVL 5

Accepted Solution

by:
ronit051397 earned 50 total points
ID: 1343153
This is an example for COPY. Figure out what it does and do the same for cut and paste. write the following:

procedure TForm1.FormCreate(Sender: TObject);
begin
  Application.OnMessage := AppMessage;
end;

procedure TForm1.AppMessage(var Msg: TMsg; var Handled: Boolean);
begin
if (Msg.hwnd = edit1.Handle) and //if the focus is in the edit1
   (Msg.Message=WM_KEYDOWN) and //if the user pressed a key
   ((Msg.wParam = 67) OR (Msg.wParam = 99)) then //if C or c was pressed
begin
    if GetKeyState(VK_CONTROL) < 0 then  //if control key is down            
    showmessage('copy is canceled');
    Handled := True;//cancel the copy action
end;


0
 

Author Comment

by:asi
ID: 1343154
10x alot its help me to get to my target
asi
b_asi@inter.net.il

0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

Introduction The parallel port is a very commonly known port, it was widely used to connect a printer to the PC, if you look at the back of your computer, for those who don't have newer computers, there will be a port with 25 pins and a small print…
Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
This video shows how to use Hyena, from SystemTools Software, to update 100 user accounts from an external text file. View in 1080p for best video quality.

738 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