Example Code

Select Folder with Folder Dialog Browser .NET Object Using LabVIEW

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
  • Other

Code and Documents

Attachment

Overview

This example shows how to create .NET instance like Folder Browser Dialog.

 

Description

When prompting the user for a path, it is sometimes desirable to not be able to select a file and only a directory. While the user could press the "Current Folder" button to return the path of the directory they are currently browsing, Windows provides a more streamlined dialog form to only select a directory.

 

Requirements

Software:

  • LabVIEW 2012 (or compatible)

 

Steps to Implement or Execute Code

1. Run VI.
2. Select Folder path from .NET Dialog and see the result as "Path" and "Button Pressed" indicators on frontpanel.

 

Additional Information or Resources

 

2012.png

 

 

NOTE: The VI's Preferred Execution System needs to be set to "user interface". This can be set under File » VI Properties.  If you do not run the VI in the user interface thread you will not be able to see your folder list.

 

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

 

 

PBear
NI RF

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

Comments
TroyK
Active Participant
Active Participant
on

Nice, although when I made mine I added a few more inputs.

Folder Browser Dialog.png

Troy - CLD "If a hammer is the only tool you have, everything starts to look like a nail." ~ Maslow/Kaplan - Law of the instrument