Customizing Menu Items

This lesson shows how to change the navigation menu in LightSwitch.

Customizing Menus

In the running application, the navigation menu provides a list of screens that are available to the user. You can add or remove menu items, change the menu text, and change the display order of menu items.

To add or remove a menu item

  1. In Solution Explorer, select the Screens node.

  2. On the Project menu, click Edit Screen Navigation.

    The Screen Navigation tab of the Application Designer appears.

    The Screen Navigation tab

  3. On the Screen Navigation tab, under the Tasks node, right-click the Current Product List node and then click Delete.

    The Current Product List menu item is removed from the navigation menu.

  4. On the Include Screen drop-down list, select Current Product List.

    The Current Product List menu item is added to the bottom of the Tasks section of the navigation menu.

To change menu text

  1. Right-click the Contact List node and then click Rename.

    The Contact List field becomes editable.

  2. In the Contact List field, type Contacts and then press ENTER.

  3. Use the same steps to rename the Current Product List node as Products.

To reorder menu items

  1. Select the Products node.

  2. In the right margin of the designer, click the Move up button.

    The Products menu item is moved above the Orders by Customer menu item.

  3. Press F5 to run the application and then verify the changes to the navigation menu.

Closer Look

When you removed and added navigation menu items earlier in this less, you may have noticed that the Include Screen drop-down list contains two additional items, Users and Roles. These are related to authentication and authorization, which are described in another lesson. The Include Screen drop-down list also contains screens that are already on the navigation menu. Although you can add a second menu item for a screen, you would just have duplicate items because both open the same instance of the screen.

When you rename a menu item, only the name that is displayed in the running application is affected. The actual screen name remains unchanged.

When you reorder menu items by using the Move Up and Move Down buttons, you can only reorder the items in that group, in this case, the Tasks group. The next lesson describes menu groups.

You may also have noticed that the Contacts menu item is displayed in bold text. This indicates that the Contacts screen is shown when the application starts. A later lesson, Setting the Startup Screen, teaches how to change the startup screen.

Next Steps

In the next lesson, you will learn how to create menu groups.

Next lesson: Adding a Menu Group

See Also

Tasks

How to: Create Menu Items and Navigation Groups

Other Resources

Creating Menus and Commands