Jump to content

Having a "browse" button in a GUI?


sunlord
 Share

Recommended Posts

Now, Does the Autoit can be interact with server that was written in other language, lets say Java?.

Are you talking about something like FileSelectFolder()? That would get the path and put it in an input?

EDIT: Misunderstood question, sorry.

Edited by BALA
[font="Comic Sans MS"]BA-LA[/font]http://ba-la.110mb.comJoin my community, CLICK HEREAlternative links to my site:http://www.ba-la.tkhttp://www.ba-la.co.nrContact me if you would like to help with some of my projects: joeythepirate@gmail.com
Link to comment
Share on other sites

#include <GUIConstants.au3>

#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Browse Button Example", 303, 141, 193, 115)
$Input1 = GUICtrlCreateInput("", 21, 19, 201, 21)
$Button1 = GUICtrlCreateButton("Browse...", 235, 16, 64, 25, 0)
$Group1 = GUICtrlCreateGroup("Browse what", 20, 44, 279, 63)
$Radio1 = GUICtrlCreateRadio("Folder", 26, 60, 113, 17)
$Radio2 = GUICtrlCreateRadio("File to open", 26, 74, 113, 17)
GUICtrlCreateGroup("", -99, -99, 1, 1)
$Button2 = GUICtrlCreateButton("Exit", 166, 111, 75, 25, 0)
$Label1 = GUICtrlCreateLabel("i542 ", 0, 0, 27, 17, -1, $GUI_WS_EX_PARENTDRAG)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

While 1
    $nMsg = GUIGetMsg()
    Select
        Case $nMsg = $GUI_EVENT_CLOSE Or $nMsg = $Button2
            Exit
        Case $nMsg = $Button1
            If GuiCtrlRead($Radio1) = $GUI_CHECKED Then
                $txt=FileSelectFolder( "Open", "C:\")
                GUICtrlSetData($Input1,$txt)
            ElseIf GuiCtrlRead($Radio2) = $GUI_CHECKED Then
                $txt=FileOpenDialog("Open", "C:\","Text files (*.txt)")
                GUICtrlSetData($Input1,$txt)
            Else
                MsgBox(64,"Browse button example","You must select something.")
            EndIf
    EndSelect
WEnd

Sony Ericsson T290i and J210i owner. :whistle:

i542

Edited by i542

I can do signature me.

Link to comment
Share on other sites

  • 7 years later...

#include <GUIConstants.au3>

#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Browse Button Example", 303, 141, 193, 115)
$Input1 = GUICtrlCreateInput("", 21, 19, 201, 21)
$Button1 = GUICtrlCreateButton("Browse...", 235, 16, 64, 25, 0)
$Group1 = GUICtrlCreateGroup("Browse what", 20, 44, 279, 63)
$Radio1 = GUICtrlCreateRadio("Folder", 26, 60, 113, 17)
$Radio2 = GUICtrlCreateRadio("File to open", 26, 74, 113, 17)
GUICtrlCreateGroup("", -99, -99, 1, 1)
$Button2 = GUICtrlCreateButton("Exit", 166, 111, 75, 25, 0)
$Label1 = GUICtrlCreateLabel("i542 ", 0, 0, 27, 17, -1, $GUI_WS_EX_PARENTDRAG)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

While 1
    $nMsg = GUIGetMsg()
    Select
        Case $nMsg = $GUI_EVENT_CLOSE Or $nMsg = $Button2
            Exit
        Case $nMsg = $Button1
            If GuiCtrlRead($Radio1) = $GUI_CHECKED Then
                $txt=FileSelectFolder( "Open", "C:\")
                GUICtrlSetData($Input1,$txt)
            ElseIf GuiCtrlRead($Radio2) = $GUI_CHECKED Then
                $txt=FileOpenDialog("Open", "C:\","Text files (*.txt)")
                GUICtrlSetData($Input1,$txt)
            Else
                MsgBox(64,"Browse button example","You must select something.")
            EndIf
    EndSelect
WEnd
Sony Ericsson T290i and J210i owner. :whistle:

i542

 

Thanks alot for the help! 

Was able to make something with this that worked for me <3

Link to comment
Share on other sites

  • Moderators

Srex,

You do realise that the post above yours dates from over 7 years ago? In future please do not resurrect threads from this far back. :naughty:

M23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind

Open spoiler to see my UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

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