cancel
Showing results for 
Search instead for 
Did you mean: 

Choosing a folder from the hard drive

Former Member
0 Kudos

Hi

I need to allow the user to choose a directory to save a logfile to from a Business One form that should get launched when they click on a browse button. I have currently got the below code which is located within the the ItemEvent.

Dim FolderWindow As New Windows.Forms.FolderBrowserDialog

FolderWindow.RootFolder = Environment.SpecialFolder.MyComputer

FolderWindow.ShowDialog()

The FolderBrowserDialog window does appear however there is nothing shown where the folder directories should be so therefore not allowing for a directory to be chosen. If I however copy the exact same code and place it into the sub Main for example it works OK.

I've had a look around the forum and theres a couple of people who look as if they've also had this problem but there's no fixes given. Does anyone know why the folders aren't being shown or another way I can allow the user to choose a directory from the Hard Drive?

Thanks

Steve

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Hello Steven

In the last year i have published a solution in c# and vb.net which is working properly.

you can donwload a simple source from:

http://www.progi-tech.hu/ShowFileOpenDialog.zip

before you call the browser window, you can tell the .NET to Acess to the filesystem by the following .NET code

Dim f As New FileIOPermission(PermissionState.None)
f.AllLocalFiles = FileIOPermissionAccess.AllAccess

Regards

J

Former Member
0 Kudos

Your code on the zip file is great but it does not work under 64 bits environments.

Former Member
0 Kudos

Hello,

it is working. you should set the compiller correctly

Regards,

J