


























TDBMemo只读时不能使用Ctrl+C复制文字,只需按下面修改就可以。
打开lazarus\lcl\include\dbmemo.inc
找到:
procedure TDBMemo.KeyDown(var Key: Word; Shift: TShiftState); begin inherited KeyDown(Key, Shift); case key of VK_ESCAPE: begin //cancel out of editing by reset on esc FDataLink.Reset; SelectAll; Key := VK_UNKNOWN; end; VK_DELETE, VK_BACK:
添加红色代码(参考网友阿英的方法):
procedure TDBMemo.KeyDown(var Key: Word; Shift: TShiftState); begin if (Shift = [ssCtrl]) and (Key = Ord('C')) and (SelLength > 0) then begin Clipboard.AsText := SelText; Key := 0; end; inherited KeyDown(Key, Shift); case key of VK_ESCAPE: begin //cancel out of editing by reset on esc FDataLink.Reset; SelectAll; Key := VK_UNKNOWN; end; VK_DELETE, VK_BACK:
重新编译应用就可以在只读时使用Ctrl+C复制文字。
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。