SaveFileDialog 或 OpenFileDialog 控件 - 创建/修改左侧文件夹按钮
有没有办法覆盖/修改/创建 SaveFileDialog 或 OpenFileDialog 控件中的左侧快捷按钮?
默认为“我最近的文档”、“桌面”、“我的文档”、“我的电脑”、“我的网络”...如何将“我最近的文档”更改为“我的超酷文件夹”?
谢谢。
Is there a way to override/modify/create the left-side shortcut buttons in the SaveFileDialog or OpenFileDialog controls?
Defaults are "My Recent Documents", "Desktop", "My Documents", "My Computer", "My Network"... how would I change "My Recent Documents" to "My Super Cool Folder"?
Thanks.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您一定使用的是旧操作系统,XP时代。 Vista 和 Win7 版本的对话框中不再存在“地点栏”。旧式对话框中显示的内容由注册表项控制。这不太适合通过单个程序进行修改。但这篇杂志文章向您展示了需要什么。
现代版本显示“收藏夹”。它们只是 c:\users\name\links 文件夹中的 .lnk 文件。您可以在我的答案中找到创建 .lnk 文件的代码 此线程。
放轻松一点,您的用户通常不太可能认为您的文件夹非常酷。除非她设置一台机器只运行你的应用程序而不执行其他任何操作。请考虑设置 InitialDirectory 属性,以便在打开对话框时预先选择您的文件夹。
You must be using an old operating system, XP era. The 'places bar' doesn't exist anymore in the Vista and Win7 version of the dialogs. What shows up in the old style dialogs is controlled by registry keys. That isn't exactly very suitable for modification by a single program. But this magazine article shows you what is needed.
The modern version shows 'Favorites' instead. They are simply .lnk files in the c:\users\name\links folder. You can find code to create a .lnk file in my answer in this thread.
Go easy on this, your user is not commonly likely to think that your folder is all that super cool. Unless she sets up a machine to only run your app and nothing much else. Consider setting the InitialDirectory property instead so that the dialog opens with your folder pre-selected.