Jump to content

Multiple Folders Selector


Recommended Posts

I made this because I wanted a specific behavior when selecting multiple folders at once.  With this UDF, you select the folders you want by checking the TreeView checkbox of each folder.  Automatically, it will show in the selection ListBox at the right of the TreeView.  If you uncheck the folder, it will be removed from the ListBox.  By selecting (highlighting) a folder, a list of the files included in that specific folder will replace the selection ListBox.  If you check/uncheck a folder, the selection ListBox will reappear.

I also needed a Root Selector that enables Drives and Network (UNC) selection that can serve to start the Multiple Folders Selector.  This is practical if you need to select a large number of folders from a specific part of the tree.  Be careful though when selecting a Root that includes hundreds of subfolders.  Selecting C:\ as a root can take quite some time to be shown.

Version 2021-03-04

* Added optional list of folders to be pre-checked (must be full path name and 0-based)


Here a simple example :

#include <Array.au3>
#include "MultiFoldersSelectorUDF.au3"

; Select root folder and return all chosen folders
Local $sSelectedRoot = _MFS_SelectRootFolder()
If @error Then Exit
Local $aListFolder = _MFS_SelectMultipleFolders($sSelectedRoot)
If Not @error Then _ArrayDisplay($aListFolder)

; Pre-check all folders starting with "Aut" in AutoIt3 root folder and returns new checked/unchecked list of folders
Local $aPreChecked = _FileListToArrayRec(@ProgramFilesDir & "\AutoIt3", "Aut*", $FLTAR_FOLDERS, $FLTAR_RECUR, $FLTAR_SORT, $FLTAR_FULLPATH)
_ArrayDelete($aPreChecked, 0)
$aListFolder = _MFS_SelectMultipleFolders(@ProgramFilesDir & "\AutoIt3", $aPreChecked)
If Not @error Then _ArrayDisplay($aListFolder)

Let me know if you find it useful. 




Edited by Nine
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Create New...