Delphi 7 - 表单中嵌入文件打开对话框
有谁知道是否可以在您自己的表单中嵌入文件打开对话框?
我们有一个选项卡式对话框,在其中一个选项卡上,我们希望用户能够浏览具有与标准打开对话框相同功能的文件,例如“查找”组合框、位置栏、shell 文件列表、文件名组合编辑 我已经考虑过使用一些第三方组件重新
创建对话框,即 Jam Shell 浏览器组件
我可以通过这种方式获得大部分功能,但我缺少一些东西,例如位置栏和文件名自动完成\建议
Does anyone know if it is possible to embed a file open dialog inside your own form?
We have a tabbed dialog and on one of the tabs we want the user to be able to browse for a file with the same functionality as the the standard open dialog e.g. 'Look in' combobox, places bar, shell file list, file name comboedit with name completion etc etc.
I've looked at recreating the dialog with some 3rd party components, namely Jam Shell Browser Components
I can get most of the functionality this way, but I'm missing a couple of things e.g. the places bar and the filename auto completion\suggestion
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(5)
我不想说这是不可能的,但考虑到您可能涉及的丑陋的 winapi hacks 的数量,我建议“使用一些第 3 方组件重新创建对话框”,但使用
VirtualShellTools。VirtualShellTools 可以从 此 SVN 存档。
这里是 Google 代码项目页面。
(至少它有文件名自动完成组合框,尽管我不确定它是否有位置栏)。 希望能帮助到你。
I don't want to say it's impossible but considering the amount of ugly winapi hacks you'd probably involve I suggest "recreating the dialog with some 3rd party components" but with
VirtualShellTools.VirtualShellTools can be downloaded from this SVN archive.
And here's the google code project page.
(At least it has the filename autocompletion combobox though i am not sure if it has the places bar). Hope it helps.
使用设置为大图标的 TListView 组件来实现位置栏并不困难。 Raize Components 库也有一些可以在这个领域提供帮助的源代码。
The places bar is not that difficult to implement using a TListView component set to large icons. The Raize Components library also has some source that would help in this arena.
需要注意的是,使用 SHAutoComplete 添加自动完成组合框相当容易。
有关详细信息,请参阅这篇文章。
Just a small note, it's fairly easy to add an auto-completing combobox with SHAutoComplete.
See this article for details.
也许这个 Shell 控件演示 可以帮助您。
编辑: ATM 网站似乎已关闭。 回溯机可以提供帮助。
这是最新下载回程机涉及的控件的链接:
Maybe this Shell Controls Demo can help you.
Edit: ATM the site seems to be down. The Wayback Machine helps.
Here's the latest download link for the controls involved from the wayback machine:
我会重新创建它:使用 VCL 组件应该不会花很长时间。 自动完成并不难,如果你浏览 Windows 文档足够长的时间,你可以获得其余的数据。
您可以通过检测选项卡更改并显示打开的对话框(就好像它是选项卡页一样)来尝试作弊。 您必须检测用户在对话框外部单击(例如在不同的选项卡上)并防止其关闭,直到您想要更改选项卡为止。
干杯
I would re-create it: it shouldn't take long with the VCL Components. The autocomplete is not hard, and you can get the rest of the data if you look through the windows docs long enough.
You can try and cheat by detecting the tab change and displaying the open dialog as if it were the tab page. You will have to detect the user clicking outside of the dialog (e.g. on a different tab) and prevent it closing until you want to change tabs.
Cheers