From 04:00 PM CDT – 08:00 PM CDT (09:00 PM UTC – 01:00 AM UTC) Tuesday, April 16, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

Example Code

Windows Explorer in your front panel

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 example shows how to use one of the .NET control to have the Windows Explorer shell in  front panel to be able to read/write files, open any folder or file and navigate to different locations on your hard drive. 


Description
The Explorer is loaded from the Shell assembly from the API Code Pack. It works pretty good just by defining the current location to be any path (e.g. "C:\Program Files\National Instruments"). It then displays the folder as if you were in a dedicated Windows Explorer window.

The drag/drop feature is native on path/string controls that have the "Allow Drop" property set to True. One just has to declare a "Value Changed" event on the path to make it effective, and use some random code in it (here, plot the data from the txt file).

Finally, to avoid having a too huge part of the FP dedicated to the Explorer, a Slide to hide/show the panel containing the .NET control is added. 


Requirements

  • LabVIEW 2012 (or compatible)
  • .NET Framework 4.0


Steps to Implement or Execute Code

  1. Run the VI
  2. Navigate in the explorer as if you were
  3. in a regular folder.
  4. Enter a new location in the address bar.
  5. Click the centered boolean to hide/show
  6. the explorer.
  7. Drag&Drop a txt file to the graph (Graph.txt)

 

Additional Information or References
VI Block Diagram

 5-56.png

 

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

 

Eric M. - Senior Software Engineer
Certified LabVIEW Architect - Certified LabVIEW Embedded Systems Developer - Certified LabWindows™/CVI Developer
Neosoft Technologies inc.

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

Comments
Jeremie_CENTUMADENEO
Member
Member
on

Interesting!!

It's important to say that sources are in Labview 2012.

Mr_J
Member
Member
on

Hi,

it looks interesting, can you save it to Labview 2011?

njm126
Member
Member
on

Hi

I found this method is very good to extend the Labview function. I have a further question:

In your program, I have to place a path file control on the FP in order to get the drag path. But if it is possible to directly get the drag file path and file name by the method and property of ExplorerBrowser? And transfer the path to the drag data and be used in the later program? It means get the path without the path file control.

Thanks a lot.

Capture.JPG

alkazaa
Member
Member
on

Hi,

I'd like to extend the use of the .NET file explorer application a bit.

But where can I find documentation for the Microsoft.WindowsAPICodePack.Shell which you have used?

 

Thanks!