delphi Edit,Memo中禁用Ctrl+V


本文整理自网络,侵删。

 uses Clipbrd, ...

//disable CTRL + V ("Paste") :: handles Edit1.OnKeyDown
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;

相关阅读 >>

Delphi spcomm串口控件的例程

Delphi中查找指定文件的例程

Delphi 去字符串长度函数 strlen,length

Delphi 取 utc/tfiletime 时间

Delphi 解决android 9上无法使用http协议

Delphi 使用 inputbox、inputquery 的启发

dbgrid导出excl表

Delphi tms web core 获取url 参数

Delphi 把文件锁定到任务栏

Delphi 检查输入的ip地址串是否合法

更多相关阅读请进入《Delphi》频道 >>



打赏

取消

感谢您的支持,我会继续努力的!

扫码支持
扫码打赏,您说多少就多少

打开支付宝扫一扫,即可进行扫码打赏哦

分享从这里开始,精彩与您同在

评论

管理员已关闭评论功能...