try something like this :

Code:
break on

$form = createobject("kixtart.form")

$lblPath = $form.Label("Path:",10,10,60,15)
$txtPath = $form.TextBox("",10,$lblPath.Bottom,200,20)

$btnBrws = $form.ToolButton("Browse...",$txtPath.Right+5,$lblPath.Bottom,60,21)
$btnBrws.FlatStyle = 1
$btnBrws.OnClick = "btnBrws_Click()"

$form.Show

while $form.Visible
$_ = execute($form.DoEvents)
loop

function btnBrws_Click()
dim $f
$f = $Form.Dialogs.FolderBrowserDialog
$f.Rootfolder = 17
if $f.ShowDialog = 1
$txtPath.Text = $f.SelectedPath
endif
endfunction



instead of updating a variable you can also refering to $txtPath.Text every time the path is needed
_________________________