How to register a hotkey for a Form and its controls

Z

zhimin

I want to register some hotkey for my form:

If user press Ctrl + Enter, the result is equals to the OK button clicked
If user press F2, the textbox txtNumber focused
and so on

I had read the document for the hot key, they are prepared for menuitem, not
for form and controls

Thanks!
 
H

Herfried K. Wagner [MVP]

* "zhimin said:
I want to register some hotkey for my form:

If user press Ctrl + Enter, the result is equals to the OK button clicked
If user press F2, the textbox txtNumber focused
and so on

I had read the document for the hot key, they are prepared for menuitem, not
for form and controls

Add a menu with menu items, assign shortcuts and hide the menu by
setting its 'Visible' property to 'False'. In the menu items' 'Click'
event handlers, add your code.
 

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