首页 > 代码库 > 添加快捷键 ShortCut

添加快捷键 ShortCut

http://docwiki.embarcadero.com/CodeExamples/Berlin/en/ShortCut_(Delphi)

 

procedure TForm1.FormCreate(Sender: TObject);
begin
  OpenCommand.ShortCut := Menus.ShortCut(Word(O), [ssCtrl]);
end;
 
procedure TForm1.OpenCommandClick(Sender: TObject);
begin
  MessageDlg(The Open command has been selected., mtInformation, [mbOk], 0);
end;

 

添加快捷键 ShortCut