Shortcut Enum

  • Thread starter Thread starter Justin Weinberg
  • Start date Start date
J

Justin Weinberg

Is there any way to expand on the prebuilt shortcut enumeration for
accelerators? Specifically - I want to add alt+control+1, alt+control+2,
etc.
 
Hello,

Justin Weinberg said:
Is there any way to expand on the prebuilt shortcut
enumeration for accelerators? Specifically - I want to
add alt+control+1, alt+control+2,
etc.

For menu items?

Regards,
Herfried K. Wagner
 
Yes, for menus. Also, I should have said shortcut keys, not accelerator
keys. I know I can work around using keypreview and the like, but I really
want alt+ctrl+1 to appear on the menu and for that keyset to perform the
action.
 
Hello,

Justin Weinberg said:
Yes, for menus. Also, I should have said shortcut keys, not
accelerator keys. I know I can work around using keypreview
and the like, but I really want alt+ctrl+1 to appear on the menu
and for that keyset to perform the action.

You can add the code for handling the key event in the 'KeyDown' event
handler ('KeyPreview = True') and add the shortcut text to the caption of
the menu item. In the menu editor, just type "Bla\tCtrl+Alt+1", at runtime
you can change the text by assigning something like that: '"Bla" &
ControlChars.Tab & "Ctrl+Alt+1"'.

HTH,
Herfried K. Wagner
 
Back
Top