Sign in to follow this  
Followers 0
sd333221

Select File in Gui?

6 posts in this topic

#1 ·  Posted (edited)

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

Share this post


Link to post
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


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

#3 ·  Posted (edited)

Yes with Koda, and check out FileOpenDialog().

Edit:

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

Edited by SmOke_N

[center]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.[/center]

Share this post


Link to post
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

Share this post


Link to post
Share on other sites

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


[center]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.[/center]

Share this post


Link to post
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

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