Delphi help
Shortcut Function
ShortCut creates a menu shortcut for a specified key combination.
Unit
Menus
Category
menu support routines
function ShortCut(Key: Word; Shift: TShiftState): TShortCut;
Description
Call ShortCut to create a menu shortcut at runtime. Specify a Key value
using a virtual key code. Specify the values for the Shift, Control, and Alt
keys by using a set of type 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
The TextToShortCut function 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
**********************************************************************
To find the virtual key codes, load WINDOWS.PAS and search for VK_
============================================
Patrick Dunford, Christchurch, NZ
http://patrick.dunford.com/
> -----Original Message-----
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On
> Behalf Of Andrew Masters
> Sent: Friday, 21 May 1999 09:06
> To: Multiple recipients of list delphi
> Subject: [DUG]: Menu Shortcut
>
>
> Hi,
>
> How do you set a menu shortcut at runtime to a function key ?
> I've got somethiing like
>
> MenuItem.Shortcut:=Shortcut(Word('M'), [ssCtrl]);
>
> for Ctrl-M which is fine BUT how to I set it to say F2.
>
> TAI
> Andrew Masters
> Clinical Solutions Ltd
> Auckland, NZ
> Ph: +64-9-476-0106
> Fax: +64-9-476-0108
> e: [EMAIL PROTECTED]
>
> ------------------------------------------------------------------
> ---------
> New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED]
> Website: http://www.delphi.org.nz
>
---------------------------------------------------------------------------
New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED]
Website: http://www.delphi.org.nz