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

Keystrokes accelarators

I need to build a program that when you press
the F12 key a message box appers, without
considerations about who has the focus at that moment.

It´s the same as the shortcut for a menu (menu accelerator),
but I can not use menus in this program.
0
vincerubus
Asked:
vincerubus
  • 2
1 Solution
 
vincerubusAuthor Commented:
Edited text of question
0
 
mcixCommented:
1. Set the KeyPreview property of the form to True
2. Insert the following the the KeyDown Event of the Form.

Select Case KeyCode

   Case vbKeyF12
      ' F12 defined in VBRUN
      MsgBox "Whatever you want to do"

End Select

0
 
vincerubusAuthor Commented:
thanks and congratulations
0

Featured Post

The new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

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