When you assign a shortcut to an menuitem (Shorcut property) the menu item's
Click is raised whenever you use that shortcut. You don't have to do
enything more then to implement your item's Click event handler
That is what I got for the click event. But how do I write the short cut key?
This is what I have been working with
Private Sub mainmenu_KeyDown(ByVal sender As Object, ByVal e As
System.Windows.Forms.KeyEventArgs) Handles MyBase.KeyDown
If e.KeyCode = Keys.Control.X Then
MsgBox("So, you want to exit???")
Close()
End If
Assign 'CtrlX' to the menu item's 'Shortcut' property at design time. No
additional code is required to make the shortcut fire the menu item's
'Click' event at runtime.
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.