Open Folder..

Lanc1988

Contributor
Joined
Nov 27, 2003
Messages
508
In my Menu, I have an option that when clicked I want it to open a folder, not a program or file.

Could someone post that code that can be used to open a folder?

Thanks in advance.
 
Folderbrowserdialog

If you are using .NET 2003 then you can use one of the control that builtin with it. I am assuming you are using VB.NET. Folderbrowserdialog control but be very careful when using this module. It contains a bug that will crash your app if the directory path longer than 135 characters (not everytime though). So it is fairly unpredictable when it crashs. Otherwise, you can use some of the browseforfolder class that will do it much better job but require some code change.
 
Hmm.. i thought it would be simplier to do. I just want it to, when clicked actually Open the folder, not inside my program, but as if you double clicked it on your desktop.
 
when you open a folder you are essentially running a program.
Windows Explorer is always run when you view a folder on your desktop.
 
Oh ok i see now, so what parts of this do i need to change?:

Process.Start("explorer.exe", Environment.GetFolderPath(Environment.SpecialFolder.ProgramFiles))
 
Oh, ill try that. So by putting a path such as, Application.StartupPath & "\Program Files\Folder", it would cause it to open the folder called "folder"?
 
Back
Top