Jump to content

Select File in Gui?


 Share

Recommended Posts

Hi,

in my GUI, i need a button "Choose File",

and when you klick it a little window pops up,

where you can choose a file...

Would be great if you could help me =)

thank you alot!

PS: Is there a way to do this with "KODA"?

Edited by sd333221
Link to comment
Share on other sites

Hi,

in my GUI, i need a button "Choose File",

and when you klick it a little window pops up,

where you can choose a file...

Would be great if you could help me =)

thank you alot!

PS: Is there a way to do this with "KODA"?

Here is an example part made with Koda but not the file select part

#include <GUIConstants.au3>
$message = "Hold down Ctrl or Shift to choose multiple files."
$Form1 = GUICreate("AForm1", 622, 448, 192, 125)
$Button1 = GUICtrlCreateButton("Choose File", 80, 40, 81, 25)
GUISetState(@SW_SHOW)
While 1
    $msg = GuiGetMsg()
    Select
    Case $msg = $GUI_EVENT_CLOSE
        ExitLoop
    Case $msg = $Button1
        $var = FileOpenDialog($message, "C:\Windows\", "Images (*.jpg;*.bmp)", 1 + 4 )
        MsgBox(4096,"","You chose " & $var)
    Case Else   
    ;;;;;;;
    EndSelect
WEnd
Exit


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

Link to comment
Share on other sites

  • Moderators

Yes with Koda, and check out FileOpenDialog().

Edit:

Or someone could just write it for you again....

Edited by SmOke_N

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Link to comment
Share on other sites

Yes with Koda, and check out FileOpenDialog().

Edit:

Or someone could just write it for you again....

Ok thank you =) i am now confrontated with the problem, how i can display

the chosen file in a disabled input box, but i think i can get that workin :P

Link to comment
Share on other sites

  • Moderators

Look at GUICtrlSetData(), you'll need to make the input box a variable.

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Link to comment
Share on other sites

Ok,

thank you alot.

My GUI is now gone.

Now i have to link all the hundreds of GUI bars, buttons and input boxes

to my main programm -__-.

I think I do this tomorrow ^^

Thank you two alot for your help.

Always very fast on the forums :P

greetings

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...