Hi Mike

> Delphi 5.1
>
> Does anyone know of a way to allow a user to view the contents of a memo,
> but not allow them to copy it?
>


Why dont you just disable Ctrl + C on the memo feild - That way the user can
not copy it to the clipboard.

Do this on the OnKeyDown Event.

Something like this;

Uses
..Clipbrd;


procedure TForm1.Memo1KeyDown(Sender: TObject; var Key: Word; Shift:
TShiftState);

begin
   if ((ssCtrl in Shift) AND (Key = ord('C'))) then // Detect CTRl + C(copy)
     begin
       if Clipboard.HasFormat(CF_TEXT) then ClipBoard.Clear; // Clear the
clip board
       Showmessage('"Copy" DISABLED!'); // Show message that copy disabled
    end;
end;



Gordon
__________________________________________________
Delphi-Talk mailing list -> [email protected]
http://lists.elists.org/cgi-bin/mailman/listinfo/delphi-talk

Reply via email to