Click here to Skip to main content
15,881,882 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Is there a way to show shortcuts using FolderBrowserDialog.

I have googled, but the closest solution is to use SaveFile Dialog - which wont work for me.

I know that shortcuts are not files or folders, but still I want to show them in FileBrowse dialog.
Posted
Comments
Patrick-Et. B. 30-Jul-14 5:17am    
Depends on what you are trying to do but you could use Microsoft.Win32.OpenFileDialog to show Folders, Files and Shortcuts.
Lakamraju Raghuram 30-Jul-14 5:22am    
I want to browse folders, not files. If it is the case of file browsing, I can use OpenFileDialog in C# itself, but as mentioned I need folder browsing only.
Thank you for your comment

1 solution

Hi Lakamraju Raghuram,

I'd just use the normal OpenFileDialog instead of the FolderBrowserDialog with a Filter for Shortcuts

C#
OpenFileDialog ofd = new OpenFileDialog();
ofd.Filter = "Shortcut|.ink";


But I don't understand your requirement - how would you know that the shortcut Points to a folder? Anyway above solution should work with no effort - of course you can always program your "SpecialDialog" - but I'd guess your requirement is just "rubbish"... maybe you want to think about it again?

Kind regards johannes
 
Share this answer
 
Comments
Lakamraju Raghuram 30-Jul-14 7:04am    
I have already commented on OpenFileDialog.
"rubbish" -- I donot think so. It may be odd, unconventional, but nevertheless needed to me.
Thanks for commenting.
johannesnestler 30-Jul-14 7:31am    
Hi,

I see, you can't use the OFD (sorry for not reading your comments good enough)... So I think you have to create your own Dialog for this requirenment (I don't see any other easy way to do that - I did that in the past, so ask for help if needed). My comment on your requirement was not intended to offend you, but I know how such "things" arrise - because someone "higher" than you thinks it's needed. I just wanted to make shure you considered "other possible" solutions for the problem to "get a path"... So good luck with you project - try to build your dialog based on the provided .net functions types (DriveInfo.GetDrives...) - though I hope you don't need to support the shell?

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900