ni.com is currently undergoing scheduled maintenance.

Some services may be unavailable at this time. Please contact us for help or try again later.

Example Code

Displaying Directory Hierarchy with the Tree Control

Code and Documents

Attachment

This example uses a Tree Control to display the hierarchy of files and folders in a given directory. The VI searches first for subfolders of the directory, then for files with names that match a pattern you specify, such as *.vi. The VI displays the files and folders of the directory in hierarchical order in a Tree Control.

Note: If you do not specify a pattern, the Tree Control displays all files except shortcuts.

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

Contributors