我想定义一个组合键来实现BUTTON的onclick 事,怎么做?是不是在onkeydown事件里!

hyd_cn 2003-08-20 09:43:58
:_
...全文
35 3 打赏 收藏 转发到动态 举报
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
chenquan 2003-08-20
  • 打赏
  • 举报
回复
form的keypreview设置为True
procedure tform1.formkeydown(sender:tobject;var key:word;shift:Tshiftstate);
begin //ctrl+alt+q
if (ssCtrl in Shift) and (ssAlt in Shift) and (key=ORD('Q')) then
button1.onclick(nil);
end;
chenquan 2003-08-20
  • 打赏
  • 举报
回复
form的keypreview设置为True
procedure tform1.formkeydown(sender:tobject;var key:word;shift:Tshiftstate);
begin //ctrl+alt+q
if (ssCtrl in Shift) and (ssAlt in Shift) and (key=ORD('Q')) then
button1.onclick(nil);
end;
江山易改 2003-08-20
  • 打赏
  • 举报
回复
在Caption里定义&S,&A表示ALT+S、ALT+A

5,388

社区成员

发帖
与我相关
我的任务
社区描述
Delphi 开发及应用
社区管理员
  • VCL组件开发及应用社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧