Joseph McDonnell
2004-08-04 08:27:05 UTC
Hi, all.
I've got a very simple problem which I thought I knew the answer to but
it's now obvious to me that I don't. I have a very simple application
which has a number of TEdits. A user wanted to copy a oft recurring
string into a field using cut and paste (control-C and control-V) from
the clipboard. Unfortunately, she forgot her last post to the clipboard
was from a Word document and not the string. When she dumped the large
amount of text in the field, it messed up the formatting of the output.
We discussed this and decided the best thing to do was to disable
pasting within the application. I thought that by setting the Form's
keypreview to true and having this...
procedure TForm1.FormKeyDown(Sender: TObject; var Key: Word;
Shift: TShiftState);
begin
if (ssCtrl in Shift) then Key:=0 ;
end;
as event handler would prevent cutting and pasting (as well as anything
else using Ctrl). However, it doesn't. What am I missing? I seem to
recall doing similar things in other versions of Delphi - I'm now using
D7 on W98/XP.
Regards
Joseph
I've got a very simple problem which I thought I knew the answer to but
it's now obvious to me that I don't. I have a very simple application
which has a number of TEdits. A user wanted to copy a oft recurring
string into a field using cut and paste (control-C and control-V) from
the clipboard. Unfortunately, she forgot her last post to the clipboard
was from a Word document and not the string. When she dumped the large
amount of text in the field, it messed up the formatting of the output.
We discussed this and decided the best thing to do was to disable
pasting within the application. I thought that by setting the Form's
keypreview to true and having this...
procedure TForm1.FormKeyDown(Sender: TObject; var Key: Word;
Shift: TShiftState);
begin
if (ssCtrl in Shift) then Key:=0 ;
end;
as event handler would prevent cutting and pasting (as well as anything
else using Ctrl). However, it doesn't. What am I missing? I seem to
recall doing similar things in other versions of Delphi - I'm now using
D7 on W98/XP.
Regards
Joseph