Complete the following steps to customize a shortcut menu for the front panel of a VI programmatically.
- Place an Event structure on the block diagram and drag out a region on the block diagram.
- Right-click the Event structure and select Edit Events Handled by This Case from the shortcut menu.
- In the Edit Events dialog box, select Pane from the Event Sources list and select Shortcut Menu Activation? from the Events list.
 |
Note LabVIEW labels the first pane as Pane. LabVIEW labels subsequent panes that you create by adding splitter bars to the front panel as Pane X, where X numbers the pane according to the order in which you create the pane. You can view the label of the pane by right-clicking the scroll bar of the pane and selecting Visible Items»Labels from the shortcut menu. |
- Click the OK button to close the dialog box.
- Place the Insert Menu Items function on the block diagram inside the Shortcut Menu Activation? Event structure.
- Right-click the item names input of the Insert Menu Items function and select Create»Constant from the shortcut menu. An array constant appears.
- Type About this Application in element 0 and Help in element 1 of the string array constant.
- Wire the MenuRef event data field to the menu reference input of the Insert Menu Items function.
- Click the Run Continuously button.
- Right-click in the front panel window. The shortcut menu includes an About this Application item and a Help item.
- Configure a Shortcut Menu Selection event to handle the selection of the items.