Jump to content

Recommended Posts

Posted

I made a GUI with an editbox and a button

i wanted the editbox to have the path of a file... [ex:C:\test.exe] and that you can modify it without browsing ....

Then, I wanted the button to open a "FileOpenDialog" to choose the path of a file [ex:C:\test.exe]

Then i make GUICtrlSetData to put the path on the editbox...

and when i want to write it on a file ... it write nothing !

When i check the GUICtrlRead, it works !!! but it write nothing...

and stranger : when i edit the editbox manually, and don't use the browse, IT WORKS ! The path is writen.

So i tried to edit the editbox manually after a browse, and , not working...

If i edit before and browse after, it work, but it write the thing i edited and not the thing browsed....

I ever tried with a staticbox too...

Anyone can help me plzzz ??

Posted

Almost all of what you said made absolutely no sense to me, and you did not include your code. Therefore i am forced to guess at what you are trying to do then make an example.

Here you go...

#Include <GUIConstants.au3>
GuiCreate ( "Example GUI", 200, 45 )
$Input = GuiCtrlCreateInput ( "", 0, 0, 150, 20 )
$BButton = GuiCtrlCreateButton ( "Browse...", 150, 0, 50, 20 )
$OButton = GuiCtrlCreateButton ( "Open", 150, 20, 50, 20 )
GuiSetState ( )
While 1
    $msg = GUIGetMsg ( )
    Sleep ( 1 )
    Select
        Case $msg = $BButton
            $fopen = FileOpenDialog ( "Pick a file", "", "All Files (*.*)" )
            GUICtrlSetData ( $Input, $fopen )
        Case $msg = $OButton
            Run ( @Comspec & ' /c start "' & GuiCtrlRead ( $Input ) & '"' )
        Case $msg = $GUI_EVENT_CLOSE
            Exit
    EndSelect
WEnd

[font="Times"] If anyone remembers me, I am back. Maybe to stay, maybe not.----------------------------------------------------------------------------------------------------------[/font][font="Times"]Things I am proud of: Pong! in AutoIt | SearchbarMy website: F.R.I.E.S.A little website that is trying to get started: http://thepiratelounge.net/ (not mine)[/font][font="Times"] ----------------------------------------------------------------------------------------------------------[/font][font="Arial"]The newbies need to stop stealing avatars!!! It is confusing!![/font]

Posted

Oh yes i find my answer on my own !

Just for information :

quick exemple of what i did :

filewriteline("config.ini","OLD THINGY")

$path = fileopendialog(lalala...)

filewriteline("config.ini","path=" & $path)

well, i only got the OLD THINGY in the config.ini

the answer is :

THE REAL PATH is writen in config.ini IN THE PATH and not in the program dir !!!

anyway, thank you, you tried to help me and spent time for me , thx

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