如何提取 TShellListView 中所选文件的名称?
我查了一下有没有人问过这个问题,好像没有。我觉得这很奇怪,因为很容易从 TShellTreeView.Path 中提取路径,并且您可以获得完全限定的路径。
然而,我尽我所能在编辑器中查看类本身的所有属性和方法 - 没有文档 - 以及我能找到的唯一可能的字符串属性,其中 tlistitems 的标题是空白的。此外,“选定”属性结果为空白。
所以问题很简单,如何提取在 TShellListView 组件中选择的任何文件的名称。另外,我确实有四个 Shell 组件链接并工作,您可以选择一个驱动器,浏览目录结构,选择一个掩码并浏览到您想要的文件。
蒂亚·
安德鲁
I've done a good search to see if anyone else has asked this question, it seems not. I find this pretty strange as it is easy to extract the path From TShellTreeView.Path and you get the fully qualified path.
However I tried as hard as I could looking through all the properties and methods of the class itself in the editor - no documentation - and the only likely string properties I could find where the captions for the tlistitems, which turn out to be blank. Also the 'selected' property turns out to be blank.
So the question is simply, how can I extract the name of any file - or files - that are selected in a TShellListView component. Also I do have the four Shell components linked and working, you can choose a drive, browse the directory structure, choose a mask and browse to the file you want.
TIA
Andrew
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果您没有激活
MultiSelect
属性,请检查SelectedFolder.PathName
属性,否则您可以迭代 Items 并检查Selected
属性。试试这个
if you don't have activated the
MultiSelect
property check theSelectedFolder.PathName
property, otherwise you can iterate over the Items and check theSelected
property.Try this