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.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Browse for path only while showing all files

Solved!
Go to solution

Is there a way to configure the LabView brose dialog to show all files but only allow selection of existing paths (Like folders only selection mode)?  I have many paths to choose from and I would like the user to be able to see the files within those paths (So they know they're selecting a populated path) but I don't want them to select those files.

 

Thanks,

 

XL600

0 Kudos
Message 1 of 12
(3,781 Views)

I asked this question a while ago and decided it was too much work for my project just for this functionality.

 

Like GerdW said, you can proabably find a Windows-style folder browser to use instead of the LabVIEW folder browser

Cheers


--------,       Unofficial Forum Rules and Guidelines                                           ,--------

          '---   >The shortest distance between two nodes is a straight wire>   ---'


0 Kudos
Message 2 of 12
(3,757 Views)
Solution
Accepted by topic author xl600

HI xl600,

 

You can use strip path when user select a file and force the path value.

I made you a VI.

Sabri JATLAOUI - Certified LabVIEW Architect - Certified LabVIEW Developer
0 Kudos
Message 3 of 12
(3,734 Views)

This isn't the ideal solution because it allows the user to select files as well as folders, but it re-opens the dialog if they do so. I don't like the idea of stripping the path if they select a file because it forces the user's hand.

Retry Folder Browse.png

Cheers


--------,       Unofficial Forum Rules and Guidelines                                           ,--------

          '---   >The shortest distance between two nodes is a straight wire>   ---'


0 Kudos
Message 4 of 12
(3,730 Views)

That should work.  I was looking into the .NET approach to restrict selection to folders only (Not even allowing the user to click on a file within the current path) but like James pointed out, that's a lot of work for a minor convienence.

 

Thanks!

0 Kudos
Message 5 of 12
(3,724 Views)

If you ever dive in to more .NET stuff, post back here. I tried the FolderBrowserDialog option, but I've always hated that interface, so I stuck with my loop above.

Cheers


--------,       Unofficial Forum Rules and Guidelines                                           ,--------

          '---   >The shortest distance between two nodes is a straight wire>   ---'


0 Kudos
Message 6 of 12
(3,716 Views)

I will.  I was googling and found this tool

 

http://www.ssware.com/articles/folderbrowserdialog-unmasked-everything-you-wanted-to-know-about-the-...

 

Alas, it takes an act of congress for my company to authorize external code libraries (Let alone pay for them).

 

Sigh....

0 Kudos
Message 7 of 12
(3,707 Views)

Ah yes, the struggle is real.

Cheers


--------,       Unofficial Forum Rules and Guidelines                                           ,--------

          '---   >The shortest distance between two nodes is a straight wire>   ---'


0 Kudos
Message 8 of 12
(3,695 Views)

What I do instead:

 

  • Set the dialog for "existing files & folders" (even select a pattern so only certain files show, e.g. *.txt or whatever).
  • If the user clicks "select folder", it will just take it.
  • If the user clicks on a file (double-click, or the button), it will strip the file name and pass the containing folder instead to the code

Works great for my purpose.

 

(I typically place the files of the selected folder into a listbox, so if the user clicks a file instead, it even sets the listbox to the selected file afterwards. Example)

 

 

0 Kudos
Message 9 of 12
(3,693 Views)

@xl600 wrote:

I will.  I was googling and found this tool

 

http://www.ssware.com/articles/folderbrowserdialog-unmasked-everything-you-wanted-to-know-about-the-...

 

Alas, it takes an act of congress for my company to authorize external code libraries (Let alone pay for them).

 

Sigh....


I'm not sure why you think you need to pay for it. Your link says it's part of .NET. I don't know that specific component, but you can find an example of calling the parallel Win32 API function in this discussion - http://forums.ni.com/t5/LabVIEW/Browse-for-Folder-dialog/m-p/301237#M157254

 

If you don't want to call external code, you can do this yourself by building the tree, but that would require some code.


___________________
Try to take over the world!
0 Kudos
Message 10 of 12
(3,673 Views)