Handling Run-Time Shortcut Menu Selections

After you customize a run-time shortcut menu statically or programmatically, you must configure an Event structure to handle each menu item in the custom menu.

Complete the following steps to handle menu items you created in a custom menu.

  1. Add an Event structure to the block diagram.

    Add Find

  2. Right-click the Event structure and select Edit Events Handled by This Case from the shortcut menu.
  3. In the Edit Events dialog box, select a control or pane from the Event Sources list and select Shortcut Menu Selection (User) from the Events list.
  4. Click the OK button to close the dialog box.
  5. Add a While Loop to the block diagram around the Event structure.

    Add Find

  6. Add a Case structure inside the Shortcut Menu Selection (User) case of the Event structure.

    Add Find

  7. Wire the ItemTag event data field to the selector terminal on the border of the Case structure.
  8. Enter the tag name of the shortcut menu item in the case selector label.
  9. Create a case for each shortcut menu item you created. For example, if you have a Help item, you can use the Control Online Help function to open a help file when a user selected Help from the shortcut menu.