• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 337
  • Last Modified:

User CTRL-R To Execute

I have a menu item button that I want to execute with a CTRL-R  I know this is a dumb question, but I have not needed to honestly ever do this before, and need to know how.
0
chrisryhal
Asked:
chrisryhal
1 Solution
 
Praveen KumarArchitectCommented:
Menu Item have ShortcutKeys Property, just set it
0
 
AlexFMCommented:
Select menu item in the Form designer, open its properties and fill ShortcurKeys property.
If you want to do this programmatically, use the code:

' Assign Ctrl+R shortcut to MyMenuItem
Me.MyMenuItem.ShortcutKeys = CType((System.Windows.Forms.Keys.Control Or System.Windows.Forms.Keys.R), System.Windows.Forms.Keys)
0
 
ZeonFlashCommented:
Yup, just set it to "CtrlR", or in code you can specify the shortcut like this:

      MenuItem1.Shortcut = Shortcut.CtrlR
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Tackle projects and never again get stuck behind a technical roadblock.
Join Now