Delphi TEdit.PasteFromClipboard won't work

I'm running Delphi XE7 on Windows 7.  I've created a simply project with a button and two edits.  This is the button click event:

procedure TForm2.Button1Click(Sender: TObject);
begin
  Edit1.Text := 'Paste this text';
  Edit1.SelStart := 6;
  Edit1.SelLength := 4; // Remove "this"
  Edit1.CutToClipboard;
  Edit2.PasteFromClipboard;
end;

This fails.  The copy and cut functions (I've tested both) work. However, the Paste function fails.  The KeyPreview property on the form is false.
 
I have no clue why this simple code is failing.

Eric
PasteTest.zip
cerebrumconsultingAsked:
Who is Participating?
 
cerebrumconsultingAuthor Commented:
Never mind. False alarm.  I just found out that my antivirus software, Webroot, was blocking the paste operations.  Would have been nice if it told me it was doing this. Sorry to trouble everyone.
0
 
Guillaume80Commented:
Hi Eric,

Edit2 is a TRzEdit while Edit1 is a TEdit.

Looks like TRzEdit doesn't handle de PasteFromClipBoard method.
Your sample project will work fine if you replace your TRzEdit with a TEdit.

GB
0
 
cerebrumconsultingAuthor Commented:
No, I just tried that.  It makes no difference even working with two TEdits.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.