Changes

Creating Top-Level Menus in Visual Basic

160 bytes added, 19:36, 23 July 2007
Creating a Top-Level Menu
Use the ''Properties'' panel to change the name of the ''Menu Strip'' object to ''mainMenu''. Click in the ''Type Here'' field at the top of the form and enter ''&File''. This as the effect of creating a menu item object labeled "File". The ampersand (&) is added to instruct Visual Basic to use the 'F' at the beginning of the file as the accelerator key for this menu item. As such, pressing Alt+F when the application is running will be equivalent to clicking on the menu item with the mouse pointer. The location of the ampersand in the menu item ''Text'' property dictates the accelerator key. For example ''H&elp'' will declare 'e' as the accelerator for this particular men item. Windows indicates the accelerator for a menu item by underlining the letter (as you will see by the underlined 'F' on your File menu item).
 
Once the File menu item has been added, Visual Studio will create both a drop down menu and a field to add another menu item as follows:
 
[[Image:Exampl.jpg]]