Jump to content

browse input help


SunnBoy
 Share

Recommended Posts

#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

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
 Share

  • Recently Browsing   0 members

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