怎么判断键盘按下的是回车键呢 怎么判断键盘按下的是回车键呢 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 procedure TForm1.WMKEYdownClick(var Msg: TWMKEYDOWN);begin if Msg.Msg = vk_Return then begin showmessage('ok'); end;end;这样写为什么不起作用啊 在keypress中写if key=#13 thenbegin showmessage('ok'); end; 知道了; 应该是if Msg.CharCode = VK_RETURN then 在keypress事件中写if key=#13 thenbegin showmessage('按下的是回车键'); end; 在keypress事件中写if key=#13 thenbegin showmessage('按下的是回车键'); end;楼上说得没有错误 keypress中写if key=#13 thenbegin showmessage('按写了回车'); end;或在mainmenu里创建一个 不可见项(如‘enter’) shortcut里 输入enter在‘enter’的onclick里写 你想执行的事件 最好使用keydown事件,keypress事件是对可见的按键的事件.keydown:if key=vk_return thenbegin.....end ; 确实是在keypress中操作,通过key的值判断 不起作用可能是因为控件的焦点不在Form 上,被其他控件接走了。你可以跟踪一下看看有没有收到消息,我估计你在窗体里面响应这个消息是收不到的。 if key=#13 thenif int(key)=13 thenif ord(key)=13 then 如何从DLL中将字符串以参数的形式传递出来呀 在定义全局变量的单元中,初始化变量的语句应该写出在哪里? 菜鸟提问:窗体出现一段时间后就消失效果的实现 求救!!在WIN2000开发得程序在WIN98下为什么不正常 delphi简单问题 Interface not supported,Delphi作Com+服务时,有客户端报此错,紧急求助!! Delphi 高速运行时字符串处理出错 一个关于用文本文件来传递数据的问题 如何调用外部的帮助文件??格式是CHM格式的? cxgriddbtableview 单元格如何输入字符 广州天河招聘 哪儿有检查Delphi程序运行中出现的内存泄露的软件下载
begin
if Msg.Msg = vk_Return then
begin
showmessage('ok');
end;
end;这样写为什么不起作用啊
begin
showmessage('ok');
end;
if key=#13 then
begin
showmessage('按下的是回车键');
end;
if key=#13 then
begin
showmessage('按下的是回车键');
end;楼上说得没有错误
if key=#13 then
begin
showmessage('按写了回车');
end;
或在mainmenu里创建一个 不可见项(如‘enter’) shortcut里 输入enter
在‘enter’的onclick里写 你想执行的事件
keydown:if key=vk_return then
begin
.....
end ;