SunnBoy Posted December 19, 2009 Share Posted December 19, 2009 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 Link to comment Share on other sites More sharing options...
Authenticity Posted December 19, 2009 Share Posted December 19, 2009 #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) GUISetState() 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 ExitLoop EndSwitch WEnd GUIDelete() Exit Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now