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 setformfullscreen()窗体全屏显示

Delphi 实现程序 动态 类名

Delphi 获取cpuid的函数

Delphi exe图标替换

Delphi 将自己的app.ico应用程序图表添加到dephi资源文件res中

Delphi json字符串转义

Delphi 判断当前活动窗口

Delphi - system.runerror

Delphi 关闭指定窗口

Delphi 全局变量 hinstance 到底是在什么时候赋值的?

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



打赏

取消

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

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

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

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

评论

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

    暂无评论...