Set the Form's keypreview property to true. In the Form's KeyDown event,
catch the key and call the same procedure as you call in the button's click
event. Or, if the Form has a Menu, add the function as a menu item and
assign F8 as the shortcut. In the click event, invoke the code.
Set the Form's keypreview property to true. In the Form's KeyDown event,
catch the key and call the same procedure as you call in the button's
click
event. Or, if the Form has a Menu, add the function as a menu item and
assign F8 as the shortcut. In the click event, invoke the code.
Note that if you are using the standard menu control (not the toolstrip) the
menu item doesn't even need to be visible in order to make the shortcut
work.
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.