本文整理自网络,侵删。
在Form的Onkeyup事件中,参数Key,为按键值:
vkMenu:菜单键
vkHardwareBack:back键
更详细的键定义在System.UITypes单元。
procedure TForm1.FormKeyUp(Sender: TObject; var Key: Word;
var KeyChar: Char; Shift: TShiftState);
begin
if Key = vkHardwareBack then
begin
//这里处理back键的代码
Key := 0;//处理完后清0.
end;
if Key=vkMenu then
begin
//处理menu键的代码
Key:=0;
end;
end;
相关阅读 >>
Delphi 2010下使用sqlitesimpleDelphi连接sqlite数据库及中文乱码问题的解决
更多相关阅读请进入《Delphi》频道 >>