LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

only directory selection file selection shouldn't be allowed

Need Directory selection popup....
file selection shouldnt be allowed..
 
0 Kudos
Message 1 of 2
(2,748 Views)
Hello,
 
when using DirSelectPopup, files are visible and can be selected by the user. The function will only return a directory, but I totally agree with you that this is very confusing for the user. There should be an option to hide the files for the user.
 
A possible solution to your problem is creating a Directory Selection Popup panel yourself, using a File Browser control (Custom Controls -> Toolslib Controls -> File Browser). This is actually a tree control, converted into a File Browser. The File Browser function panel is located here: C:\Program Files\National Instruments\CVI80\toolslib\custctrl. Note that the CVI80 directory name is different for each CVI version. In this function panel you will find the FileBrowser_Create function, which transforms the Tree control into the file browser. Now you can use the FileBrowser_SetAttribute function to change the File Browser's attributes. This way you can enable the 'Browse Directories Only' option.
 
A disadvantage of using this file browser is that it doesn't look very need, and you have to program the whole thing yourself.
 
Good luck,
Wim
0 Kudos
Message 2 of 2
(2,747 Views)