OpenFileDialog 中的自定义文本和下拉按钮选项?
我最近尝试了最新版本的 WinZip,并在“Zip”文件对话框中看到了文本和选项...
我怎样才能在 C# 中做到这一点?
顺便说一句,如果您还没有弄清楚...我正在谈论 Vista/7 打开文件对话框。
我宁愿有代码,而不是“你从[本文]中获取[x]行代码来执行[此]并自己弄清楚其余部分”。如果可以的话,我会那么做的。
I've recently tried the newest version of WinZip and saw the text and options in the "Zip" file dialog...
How can I do this in C#?
By the way, if you haven't figured it out yet... I am talking about the Vista/7 Open File Dialog.
I would rather have code than a "you take [x] line(s) of code from [this article] to do [this] and figure out the rest yourself". If I could, I would have done that.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
我对此全力以赴,并使用 win32 API 函数来自定义对话框。
仅当我的应用程序在 Windows Vista 或 7 上运行时才有效。
(很抱歉这么晚才回答,但我忘记了这个问题......)
I went all Rambo on this and I used the win32 API functions to customize the dialog.
Works only when my app runs elevated on Windows Vista or 7.
(Sorry for answering so late, but I forgot about this question...)
据我所知,默认的打开文件对话框无法执行任何重要的自定义操作。您必须创建自己的。这还不错,因为您可以使用文件浏览器控件来完成大部分复杂的工作。
编辑:显然“文件浏览器控制”来自我的想象,而不是我的记忆。我找不到标准的 Microsoft 发布的文件浏览器控件。因此您的选择是:
To my knowledge, no significant customization can be performed with the default open file dialogue. You'll have to create your own. This isn't too bad, since you can use a file browser control to do most of the complex stuff.
Edit: Apparently "file browser control" came from my imagination and not my memory. I can't find a standard Microsoft-issue file browser control. So your options are:
您可以使用 IFileDialogCustomize 接口来实现自定义,但这可能非常麻烦、耗时且不灵活。
另一种选择是使用第三方控件,例如 Shell MegaPack,它们是用于放置 Windows 资源管理器(如 file/)的控件以您自己的形式浏览文件夹。
免责声明:我在 LogicNP Software 工作,该软件是 Shell MegaPack 的开发人员。
You can use the IFileDialogCustomize interface to achieve the customization, but this can be very cumbersome and time-consuming and inflexible.
Another alternative is to use third party controls like Shell MegaPack which are controls for putting Windows Explorer like file/folder browsing in your own forms.
DISCLAIMER: I work for LogicNP Software, the developers of Shell MegaPack.