这是别人的一段程序,我还没调过
type
TMyComponent = class (TgriphControl)
...
protected
procedure CMWantSpecialKey(var Message: TCMWantSpecialKey); message
CM_WANTSPECIALKEY;
end;
procedure TMyComponent.CMWantSpecialKey(var Message: TCMWantSpecialKey);
begin
inherited;
if Message.CharCode = VK_LEFT then
Message.Result := 1;
end;
type
TMyComponent = class (TgriphControl)
...
protected
procedure CMWantSpecialKey(var Message: TCMWantSpecialKey); message
CM_WANTSPECIALKEY;
end;
procedure TMyComponent.CMWantSpecialKey(var Message: TCMWantSpecialKey);
begin
inherited;
if Message.CharCode = VK_LEFT then
Message.Result := 1;
end;
解决方案 »
- DLL窗体后关闭报错??
- 困扰中,用ADO连接一个DBF文件提示"字段大小过长"?
- 主从表,主表在数据库01 从表在数据库02 请问各位大侠,给个例子和思路吧!在线等!
- 在PASCAL 7.0 输入程序运行后,总是在 VAR 处提示:ERROR 85 :";" EXPECTED ,是怎么回事?
- 哪里有Delphi6企业版下载(delphi6.0 enterprise edition),我的版本不能升级为pd2!
- 求加密算法!
- 如何用程序屏蔽sqlserver 中的触发器?
- delphi6难题!!
- 指针问题,幼稚问题,很好拿分,别错过哦!
- 请教所有学DELPHI的大虾!
- 文档
- activex的变量类型的问题
声明:
procedure WMKeyDown(var Msg:TMessage);WM_KeyDown;实现:
procedure TMyComponent.WMKeyDown(var Msg:Tmessage);
begin
inherited;
if Msg.Param=Vk_Left then
beign
;//capture the vk_left pressing down message
end;
end;end;
Shift: TShiftState);
begin
if key=VK_LEFT then
showmessage('ok');
end;
type
TForm1 = class(TForm)
private
{ Private declarations }
public
procedure test(var msg:Tmessage);message WM_KeyDown;//这里定义
end;var
Form1: TForm1;implementation{$R *.dfm}
procedure Tform1.test(var msg:Tmessage);
begin
if msg.WParam=Vk_Left then//这里触发
showmessage('OK');
end;