Shortcut Enum

  • Thread starter Justin Weinberg
  • 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.
 
H

Herfried K. Wagner [MVP]

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
 
J

Justin Weinberg

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.
 
H

Herfried K. Wagner [MVP]

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top