kor Posted March 31, 2011 Posted March 31, 2011 I'm trying to replicate the functionality of having an input that you can either type a file path in... or click a browse button and it opens a fileopen dialog. Then once you select the file to open, it puts the path into that input. What is this method called?
smartee Posted March 31, 2011 Posted March 31, 2011 Ok here is one way to do it#include <ButtonConstants.au3> #include <EditConstants.au3> #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #Region ### START Koda GUI section ### Form= $Form1 = GUICreate("Form1", 211, 67, 388, 177) $Input1 = GUICtrlCreateInput("", 8, 8, 193, 21) $Button1 = GUICtrlCreateButton("Browse", 8, 32, 75, 25) GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $Button1 $path=FileOpenDialog("Select File",@ScriptDir,"All(*.*)") GUICtrlSetData($Input1,$path) EndSwitch WEnd
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