How program function keys (e.g. F1, F2) in Windows app?

  • Thread starter Thread starter Ronald S. Cook
  • Start date Start date
R

Ronald S. Cook

I'm writing a Windows app and want to associate function keys with some of
my menu items (e.g. Help (F1)) and buttons. How can I do this, please?

Thanks.
 
Ronald said:
I'm writing a Windows app and want to associate function keys with some of
my menu items (e.g. Help (F1)) and buttons. How can I do this, please?

Thanks.

For menu items - you simply set it's shortcut propertie to the function
key you want it to use...
 
Ronald S. Cook said:
I'm writing a Windows app and want to associate function keys with some of
my menu items (e.g. Help (F1)) and buttons.

Menu items have a 'Shortcut' property which can be used to assign keyboard
shortcuts to them. Buttons support shortcuts by embedding an ampersand
character in their 'Text' property value, such as "&Save", which will make
Alt+S raise the button's 'Click' event.
 
Ronald S. Cook said:
I'm writing a Windows app and want to associate function keys with
some of my menu items (e.g. Help (F1)) and buttons. How can I do
this, please?


Set the Shortcuts property for menus. Handle the KeyDown event at form level
(KeyPreview = True) to handle them without a menu.


Armin
 
Back
Top