Jump to content
Sign in to follow this  

browse input help

Recommended Posts


hi im writing a simple GUI

now i have a input box

beside i got a button that says browse

i used the FileSelectFolder thing

but when simeone selects a folder how can i get the path of the folder

to be in the input box

thank you guys

Share this post

Link to post
Share on other sites

#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>

Local $hGUI, $Label, $Input, $Btn, $aPos, $sPath

$hGUI = GUICreate("Choose Folder...", 400, 100)
$Label = GUICtrlCreateLabel("Choose Folder: ", 10, 40, -1, -1, BitOR($SS_CENTER, $SS_CENTERIMAGE))
$aPos = ControlGetPos($hGUI, "", $Label)
$Input = GUICtrlCreateInput("", $aPos[0]+$aPos[2]+10, 40, 200, 25)
$Btn = GUICtrlCreateButton("Browse", $aPos[0]+$aPos[2]+220, 40, 70, 25)

While 1
    Switch GUIGetMsg()
        Case $Btn
            $sPath = FileSelectFolder("Choose Folder", "", 7)
;~          If $sPath Then GUICtrlSetData($Input, FileGetShortName($sPath))
            If $sPath Then GUICtrlSetData($Input, $sPath)
        Case $GUI_EVENT_CLOSE


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