From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

UI Interest Group Blog

Community Browser
cancel
Showing results for 
Search instead for 
Did you mean: 

Adding to the shortcut menus at runtime

SimonH
NI Employee (retired)

After seeing this idea exchange post I decided to investigate a couple of ways of implementing that functionality in LabVIEW today.

In this video (and the attached code) I demonstrate two reusable ways of adding an "Explore" option to file paths. The first is creating a new XControl that adds the Explore option but otherwise behaves and looks like the File Path control. The advantage of this technique is that the Explore option is available at edit time. Downsides include having to replace any existing file paths with the XControl and incompatibility with arrays and the like.

The second technique uses the concept of a "BRAT VI" (a child that controls the parent). You drop my VI on your diagram and it adds the Explore option at runtime to any path control or indicator on the front panel of that VI. It does this by getting a reference to it's caller, and registering to recieve events for any path control whenever the shortcut menu is activated or a menu item is selected.