Example Code

Setting Checkmarks Programmatically on Shortcut Menus

Code and Documents

Attachment

Overview
This example VI shows how to check items programmatically on the run-time menu of a Graph Control.

 


Description
A custom run-time menu is created by right-clicking the Graph Control and clicking Advanced » Run-Time Shortcut Menu » Edit. It can keep track of which options the user has selected and display this each time the shortcut menu is loaded. The shortcut menu consists of three options as the front panel shows below.

 


Requirements

  • LabVIEW 2012 (or compatible)


Steps to Implement or Execute Code

  1. Download and unzip the attached folder to your computer
  2. Open the VI "Check Menu Items 2012 NIVerified.vi"
  3. Run the program
  4. Right click on "Graph Control" to choose the "Shortcut Menu"

 

Additional Information or References
VI Snippet

 VI Snippet.png

 

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

 

Jared A.
Applications Engineer
National Instruments

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

Comments
DonRoth
Active Participant
Active Participant
on

This example relates well to the discussion shown here and will be easily adaptable for my specific case where I want to disable the other items under the same parent menu after one item gets checked, or re-enable those same items after the one item gets unchecked.

I will have to test it also in an executable based on prior issues with right-click shortcut menus in executables (see here).

I can envision having to build the menu at run-time again for the executable.

I have posted an example that builds on the above here.

Thanks,

Don