Sign in to follow this  
Followers 0

showing folders structures

3 posts in this topic


I have a folder with some sub folders inside.

Is there an easy way to insert the sub folders names into a listbox?

Also, is there an option to turn treeview into a diretory structure view?


Share this post

Link to post
Share on other sites

#2 ·  Posted (edited)

Hi, list sub folders of a directory in a listbox is pretty easy..

#include <File.au3>

$Gui = GUICreate("List Folders", 400, 300)
$List = GUICtrlCreateList("",10,10,380,250)
$Button = GUICtrlCreateButton("Browse", 160, 270, 80, 20)

While 1
    $msg = GUIGetMsg()
    Switch $msg
        Case $GUI_EVENT_CLOSE
        Case $Button
            Local $FSF = FileSelectFolder("Browse for folder.", "")
            If Not @error And FileExists($FSF) Then
                Dim $FL2A = _FileListToArray($FSF, "*", 2)
                If Not @error Then
                    WinSetTitle($Gui, "", $FL2A[0] & " folder(s) found in " & $FSF)
                    GUICtrlSetData($List, "")
                    For $i = 1 to $FL2A[0]
                        GUICtrlSetData($List, $FL2A[$i])

As for the treeview part of your question I didn't quite understand it..

Elaborate a bit more on what you mean and I could probably answer your question.


Edit: removed not needed style from listbox.. lol

Edited by smashly

Share this post

Link to post
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
Sign in to follow this  
Followers 0