/*
HotKey example
To use this example, create a form with a main menu component and a HotKey component.  At design time, use the Menu designer to add menu items, including a "File" menu with subitems that includes a "New" menu item.  Add the following code to the OnCreate method of the form and the OnClick event of the File menu item.
*/
void __fastcall TForm1::FormCreate(TObject *Sender)
{
  // Default to "Ctrl + A"
  HotKey1->Modifiers.Clear();
  HotKey1->Modifiers << hkCtrl;
  // Don't allow shift or alt
  HotKey1->InvalidKeys.Clear();
  HotKey1->InvalidKeys << hcShift << hcAlt;
  HotKey1->Visible = false;
}
void __fastcall TForm1::File1Click(TObject *Sender)
{
  // Assign HotKey to the menu's File "New" item. 
  New1->ShortCut = HotKey1->HotKey;
}
 
