Example Code

Only View a Single Branch of a Tree Control at a Time

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 only have a single 'branch' to be expanded at a time.


Description:

When using tree controls, it is sometimes desirable to only see a single 'branch' or 'thread' of that tree at a time. By default, if you expand a branch in a tree control, it remains expanded until you close it. This VI demonstrates how to only have a single 'branch' to be expanded at a time. So, if you had one branch expanded and expanded a seperate branch, this VI programmatically closes all other branches.


Requirements: LabVIEW 2012 (or compatible). Hardware: none.


Steps to Implement or Execute Code:

1. Run the VI.
2. Expand the different branches of the 'Controlled Tree Control'.
3. Notice that if you expand a separate branch, the previously open branch closes.
4. Expand the different branches of the 'Default Tree Control'.
5. Notice that expanding one branch has no effect on other branches.


Additional Information or References: 

 

Only View a Single Branch of a Tree Control at a Time FP.png

 

Only View a Single Branch of a Tree Control at a Time BD.png


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

Hope this helps.
-Ben

WaterlooLabs

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