Page 210 - Open Soource Technologies 304.indd
P. 210
Event Driven Programming
for that menu item. This letter will automatically be underlined in the menu. The menu
title text is displayed in the menu control list box.
4. In the Name text box, type the name that you will use to refer to the menu control in code.
See “Menu Title and Naming Guidelines” later in this chapter.
5. Click the left arrow or right arrow buttons to change the indentation level of the control.
6. Set other properties for the control, if you choose. You can do this in the Menu Editor or
later, in the Properties window.
7. Choose Next to create another menu control –or– Click Insert to add a menu control
between existing controls. You can also click the up arrow and down arrow buttons to
move the control among the existing menu controls.
8. Choose OK to close the Menu Editor when you have created all the menu controls for that
form.
The menu titles you create are displayed on the form. At design time, click a menu title to drop
down its corresponding menu items.
9.2 Assigning Access Keys and Shortcut Keys
You can improve keyboard access to menu commands by defining access keys and shortcut keys.
9.2.1 Access Keys
Access keys allow the user to open a menu by pressing the ALT key and typing a designated
letter. Once a menu is open, the user can choose a control by pressing the letter (the access key)
assigned to it. For example, ALT+E might open the Edit menu, and P might select the Paste menu
item. An access-key assignment appears as an underlined letter in the menu control’s caption,
as shown in Figure 9.2.
Figure 9.2: Access Keys.
9.2.1.1 To Assign an Access Key to a Menu Control in the Menu Editor
1. Select the menu item to which you want to assign an access key.
2. In the Caption box, type an ampersand (&) immediately in front of the letter you want to
be the access key.
204 LOVELY PROFESSIONAL UNIVERSITY