delphi edit怎么屏蔽ctrl+v

2025-04-08 17:36:19
推荐回答(1个)
回答1:

procedure TForm1.Edit1KeyDown(Sender: TObject; var Key: Word; Shift: TShiftState) ;
begin
if ((ssCtrl in Shift) AND (Key = ord('V'))) then
begin
if Clipboard.HasFormat(CF_TEXT) then ClipBoard.Clear;
Edit1.SelText := '"Paste" DISABLED!';
Key := 0;
end;
end;