Geting a Browse Dialog and Passing it to Text Filed

Hi All,

I have done some goggling without any luck. I want to click a submit button, that brings up a browse folder dialog. When i click “open” i want to pass the path of where i browse too into a textfield box.

is this possible via XOJO?

Thanks for any help

Clicking a Submit button in your application? And filling in a TextField box in your application? Yes. In the “Action” event of your Submit button, add something like:

Dim f As FolderItem = GetOpenFolderItem()

If f <> Nil Then
    MyTextField.Text = f.NativePath
End If

Take a peek at: http://documentation.xojo.com/index.php/GetOpenFolderItem and http://documentation.xojo.com/index.php/FolderItem for more information.

Thanks Jeremy

Hey @Jeremy Cowgar

is there a way to get the full Path, rather than just the Folder name. e.g. Volume/Users/TEST/Documents , rather than Documents

Hm, that should be doing it, from what I can understand. Add a break point at the MyTextField.Text = f.NativePath line in your code and run. Then look in the debugger and select the “f” variable. It should then show you all sorts of options available and what they are currently reporting as.

For me (just tested) it is showing the full path and a MsgBox f.NativePath displays the full path also. Is the TextField maybe too small and you are just seeing the tail end of it? i.e. the Documents part?