Solved

Disable copy/cut/past from Tedit

Posted on 1997-08-30
2
324 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
2 Comments
 
LVL 5

Accepted Solution

by:
ronit051397 earned 50 total points
Comment Utility
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
Comment Utility
10x alot its help me to get to my target
asi
b_asi@inter.net.il

0

Featured Post

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

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…
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…
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…

763 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

10 Experts available now in Live!

Get 1:1 Help Now