dcsimg
Login | Register   
RSS Feed
Download our iPhone app
TODAY'S HEADLINES  |   ARTICLE ARCHIVE  |   FORUMS  |   TIP BANK
Browse DevX
Sign up for e-mail newsletters from DevX

By submitting your information, you agree that devx.com may send you DevX offers via email, phone and text message, as well as email offers about other products and services that DevX believes may be of interest to you. DevX will process your information in accordance with the Quinstreet Privacy Policy.


Tip of the Day
Language: Visual Basic
Expertise: Intermediate
Jan 13, 1999

WEBINAR:

On-Demand

Application Security Testing: An Integral Part of DevOps


Custom Menu Accelerators

To set the shortcut key of a menu item to something other than what the VB menu editor displays, use this code in the Form_Load event of a form:
 
	Private Sub Form_Load()
		mnuExit.Caption = mnuExit.Caption & vbTab & "ALT+F4"
	End Sub
This adds the text "ALT+F4" to the caption of the mnuExit menu item and right-justifies it with any other shortcuts on the menu. ALT+F4 is already supported by Windows to close a window, so this shortcut needs no additional code for an exit menu choice. If you add shortcuts that Windows doesn't internally support, then set the KeyPreview property of the form to True and check the KeyUp event on the form to see if the shortcut was selected.
Dave Kinsman
 
Comment and Contribute

 

 

 

 

 


(Maximum characters: 1200). You have 1200 characters left.

 

 

Sitemap
Thanks for your registration, follow us on our social networks to keep up-to-date