Jump to content
Sign in to follow this  
ARozanski

Browse Function

Recommended Posts

ARozanski

I want to create a GUI - which asks has an option to type in the Folder location into an input box OR to browse for it by clicking a button...but if the user chooses to browse for it - i would like the new folder location to show up in the input box...

this is my code so far:

CODE
#include <GUIConstants.au3>

#Include <EditConstants.au3>

$Head = GUICreate("Test", 1000,650)

;TABS*************************************************************

$Tabmenu = GUICtrlCreateTab( 10, 290,600,330 )

;TAB1--------

$Tab1 = GUICtrlCreateTabItem('Menu')

GUICtrlCreateLabel("Username:",20,355)

$Username = GUICtrlCreateInput("<Username>",97,353,150,20)

GUICtrlCreateLabel("Password:",267,355)

$Password = GUICtrlCreateInput("<Password>",327,353,150,20,$ES_PASSWORD)

GUICtrlCreateLabel("Folder:",20,385)

$text = 'C:\Program Files\'

$Location = GUICtrlCreateInput($text,97,383,380,20)

$Browse = GUICtrlCreateButton("...",482,383,25,20)

;END OF TAB1

;TAB2-----------

$Tab2 = GUICtrlCreateTabItem('Menu')

;END TAB2-------

GUICtrlCreateTabItem("")

;END TABS********************************************************

GUISetState(@SW_SHOW)

While 1

$nMsg = GUIGetMsg()

Switch $nMsg

Case $GUI_EVENT_CLOSE

Exit

Case $Browse

$text = FileSelectFolder("Choose a folder.","")

EndSwitch

WEnd

What i tried was making the text in the input box a variable but clearly that doesn't work... :-/

Share this post


Link to post
Share on other sites
ARozanski

Thanks alot...found it :-D

Share this post


Link to post
Share on other sites
Andreik

Use search to find another topics like yours and read informations in help file.

Make from help file your friend. :P


When the words fail... music speaks

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  

×