Lanc1988 Posted December 9, 2003 Posted December 9, 2003 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. Quote
Hughng Posted December 10, 2003 Posted December 10, 2003 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. Quote
Lanc1988 Posted December 10, 2003 Author Posted December 10, 2003 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. Quote
Leaders dynamic_sysop Posted December 10, 2003 Leaders Posted December 10, 2003 like this you mean? ... Process.Start("explorer.exe", Environment.GetFolderPath(Environment.SpecialFolder.ProgramFiles)) Quote
Lanc1988 Posted December 11, 2003 Author Posted December 11, 2003 Yeah.. but that starts a program, i want it to open a folder. Quote
bpayne111 Posted December 11, 2003 Posted December 11, 2003 when you open a folder you are essentially running a program. Windows Explorer is always run when you view a folder on your desktop. Quote i'm not lazy i'm just resting before i get tired.
Lanc1988 Posted December 11, 2003 Author Posted December 11, 2003 but if its a program, whats the ending for the folder? (example: .exe or .bmp or .ini) Quote
Administrators PlausiblyDamp Posted December 11, 2003 Administrators Posted December 11, 2003 Folders don't have an extension - they are just folders. Explorer is what displays folders. Quote Posting Guidelines FAQ Post Formatting Intellectuals solve problems; geniuses prevent them. -- Albert Einstein
Lanc1988 Posted December 11, 2003 Author Posted December 11, 2003 Oh ok i see now, so what parts of this do i need to change?: Process.Start("explorer.exe", Environment.GetFolderPath(Environment.SpecialFolder.ProgramFiles)) Quote
Leaders dynamic_sysop Posted December 12, 2003 Leaders Posted December 12, 2003 change the path ( ie: Environment.GetFolderPath(Environment.SpecialFolder.ProgramFiles ) , for example ... Process.Start("explorer.exe", "Your Path goes here") Quote
Lanc1988 Posted December 12, 2003 Author Posted December 12, 2003 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"? Quote
Leaders dynamic_sysop Posted December 12, 2003 Leaders Posted December 12, 2003 yeah , just put the path of the folder ( no need for a \ after it ) , as long as it's a valid folder path it should open fine :) Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.