Jump to content
Sign in to follow this  

how do you put file path into an input after a user clicks open?

Recommended Posts

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?

Share this post

Link to post
Share on other sites

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)
#EndRegion ### END Koda GUI section ###

While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
        Case $Button1
            $path=FileOpenDialog("Select File",@ScriptDir,"All(*.*)")

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  

  • Recently Browsing   0 members

    No registered users viewing this page.

  • Create New...