Vcl.Menus.ShortCut

From RAD Studio API Documentation
Revision as of 20:15, 11 November 2011 by L10nBot (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Delphi

function ShortCut(Key: Word; Shift: TShiftState): TShortCut;

C++

extern DELPHI_PACKAGE System::Classes::TShortCut __fastcall ShortCut(System::Word Key, System::Classes::TShiftState Shift);

Contents

Properties

Type Visibility Source Unit Parent
function public
Vcl.Menus.pas
Vcl.Menus.hpp
Vcl.Menus Vcl.Menus

Description

Creates a menu shortcut for a specified key combination.

Call ShortCut to create a menu shortcut at run time.

Specify a Key value using a virtual key code (Menus version) or Qt key code (QMenus version).

Specify the values for the SHIFT, CTRL, and ALT keys by using a set of type System.Classes.TShiftState. For example, to specify the SHIFT key, use the set [ssShift]. To specify a SHIFT and CTRL key combination, use the set [ssShift, ssCtrl].

Assign the value returned by ShortCut as the value of the ShortCut property of a menu item.

Note: TextToShortCut can also create a shortcut. TextToShortCut converts a string to a shortcut, so it can be used to let the user specify the shortcut. However, TextToShortCut executes much more slowly than ShortCut. Use ShortCut whenever possible.

See Also


Code Examples

Personal tools
Translations