Sign in to follow this  
Followers 0
mattfaust

button to select a file

3 posts in this topic

is there a way to select a file by a button?

I cant seem to the command

Share this post


Link to post
Share on other sites



is there a way to select a file by a button?

I cant seem to the command

FileOpenDialog() ?


- MoChr(77)& Chr(97)& Chr(100)& Chr(101)& Chr(32)& Chr(121)& Chr(97)& Chr(32)& Chr(108)& Chr(111)& Chr(111)& Chr(107)-------I've told you 100,000 times not to exaggerate!-------Don't make me hit you with my cigarette hand...-------My scripts:Random Episode Selector, Keyboard MouseMover, CopyPath v2.1, SmartRename for XP,Window Tracer[sup]New![/sup]

Share this post


Link to post
Share on other sites

How about

#include <GUIConstants.au3>
$Form1 = GUICreate("Form1", 292, 150, 193, 115)
$Button1 = GUICtrlCreateButton("Select File", 88, 32, 105, 33, 0)
GUISetState(@SW_SHOW)
While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit
        Case $Button1
            $message = "Hold down Ctrl or Shift to choose multiple files."
            $var = FileOpenDialog($message, @WindowsDir & "\", "Images (*.jpg;*.bmp)", 1 + 4)
            If @error Then
                MsgBox(4096, "", "No File(s) chosen")
            Else
                $var = StringReplace($var, "|", @CRLF)
                MsgBox(4096, "", "You chose " & $var)
            EndIf
    EndSwitch
WEnd


Get Beta versions Here Get latest SciTE editor Here AutoIt 1-2-3 by Valuater - A great starting point.

Time you enjoyed wasting is not wasted time ......T.S. Elliot
Suspense is worse than disappointment................Robert Burns
God help the man who won't help himself, because no-one else will...........My Grandmother

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  
Followers 0