Example Code

Dynamic creation of right click User menu for control

Products and Environment

This section reflects the products and operating system used to create the example.

To download NI software, including the products shown below, visit ni.com/downloads.

    Software

  • LabVIEW

Code and Documents

Attachment

Overview
This VI Demonstrates how to dynamically create right click user menu for one control or indicator.

 
Description
It is easy to create one user right click menu for control (or indicator) in edit mode. But this menu is static and can't evaluate during time.

This example show you how do that with events and how dynamically modify it.

Note: Like menu is dynamically created, it isn't saved in control (like in edit mode) and is completely recreate each time you right click on control. For this reason, it is unnecessary to delete user menu items between two right click actions.

  

Requirements

  1. LabVIEW 2012 (or compatible)


Steps to Implement or Execute Code

  1. Run Vi.
  2. Right click on "Cadran" and you obtain traditional Application Menu.
  3. Set Menu Type to User.
  4. Right click on "Cadran" and you obtain dynamic User Menu.
  5. Play action, and try again.

 

Additional Information or References

VI Snippet

 Dynamic Right Click menu on control 2012 NIVerified.png   

 **This document has been updated to meet the current required format for the NI Code Exchange.**

Example code from the Example Code Exchange in the NI Community is licensed with the MIT license.