Jump to content

Recommended Posts

Posted

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?

Posted

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

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
  • Recently Browsing   0 members

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