怎样屏蔽edit中的快捷键??/Ctrl+A 、V、C等???
解决方案 »
- 不加控件能显示信息吗?
- DBChart 同时显示左右坐标
- 如何在dbgrid中实现动态查找功能,并显示出来供选择?
- dbgrid 怎么排序的问题?给贴有分!
- 在delphi6上如何升级到INDY9控件
- 烦人的东西!!!!请求HELP!!!!!!!!!!!
- 寻求解决密码问题?????
- 请各位高手给推荐两本VCL的书
- 数据类型转换问题! byte&char to string 在线等。。。。。
- 如何给Graphic和Memo字段赋值?请教!
- 双击让DNGRID显示记录?
- 请回答http://expert.csdn.net/Expert/topic/2508/2508449.xml?temp=.7403986的朋友来领分
begin
if Key = #1 then//屏蔽Ctrl+A
//Ctrl+A---Ctrl+Z分别是#1到#26
Key = #0;
end;
if Key = #3 then Key := #0; // Ctrl + C;
if Key = #22 then Key := #0; // Ctrl + V;
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls;type
TForm1 = class(TForm)
Label1: TLabel;
Label2: TLabel;
procedure FormCreate(Sender: TObject);
procedure FormClose(Sender: TObject; var Action: TCloseAction);
private
{ Private declarations }
HotKeyId: Integer;
procedure HotKeyDown(var Msg: Tmessage); message WM_HOTKEY; //热键消息响应
public
{ Public declarations }
end;var
Form1: TForm1;implementation{$R *.dfm}procedure TForm1.HotKeyDown(var Msg: Tmessage);
begin
if (Msg.LparamLo = MOD_CONTROL) And ((Msg.LParamHi=$41) or (Msg.LParamHi=$43) or (Msg.LParamHi=$56)) then
begin
//showmessage('A');在这里什么也不做
end;
end;procedure TForm1.FormCreate(Sender: TObject);
begin
HotKeyId := GlobalAddAtom('HotKey') - $C000;
RegisterHotKey(handle, hotkeyid, MOD_CONTROL,$41);
RegisterHotKey(handle, hotkeyid, MOD_CONTROL,$43);
RegisterHotKey(handle, hotkeyid, MOD_CONTROL,$56);
end;procedure TForm1.FormClose(Sender: TObject; var Action: TCloseAction);
begin
UnRegisterHotKey(handle, HotKeyId);
end;