Example Code

Using Programmatic Run-Time Shortcut Menus to Modify Individual Table Cells

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

Description

Overview: This VI demonstrates one way to programmatically perform different actions to a
single cell in a table control or indicator.


Description:

This example uses a custom right-click menu to refresh individual table cells with a random number.  An event determines whether the user right-clicked on the table and will display a custom shortcut menu.  Depending on the selection, the event structure will either refresh the cell with a random double or clear the contents. 

This VI was made using these references:

LabVIEW Help:  Customizing Run-Time Shortcut Menus for Controls Programmatically

LabVIEW Help:  Handling Run-Time Shortcut Menu Selections


Requirements: LabVIEW 2012 (or compatible).


Steps to Implement or Execute Code:

1. Run the VI.
2. Right click on a cell.
2. Refresh Cell will generate a random value.
3. Clear Cell will clear the value of the cell.


Additional Information or References: 

 

Using Programmatic Run-Time Shortcut Menus to Modify Individual Table Cells FP.png

 

Using Programmatic Run-Time Shortcut Menus to Modify Individual Table Cells BD.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.

Comments
Todd S.
NI Employee (retired)
on

Great code, and good documentation.  Thanks!

Todd S.
LabVIEW Community Manager
National Instruments