请问如何得到ShellListView控件中所选定文件的文件名和路径?谢谢 请问如何得到ShellListView中说选定文件的文件名和路径? 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 ShellListView1.SelCount 可知是否有选中ShellListView1.SelectedFolder.IsFolder 判断是文件还是目录ShellListView1.SelectedFolder.PathName 文件名或路径名 Edit1.Text:=ShellListView1.Folders[ShellListView1.ItemIndex].PathName; ShellListView1.SelectedFolder.PathName 其中的ListItem.Data类型是TShellFolder的指针,不过需要进行强制类型转换。它还包括了其它的信息,可以按需提取。需要使用这两个Unituses ShellCtrls, ShellAPI;Implimentationprocedure TForm1.ShellListView1Click(Sender: TObject);begin Edit1.Text:= TShellFolder(ShellListView1.Selected.Data).PathName;end; RichEdit 控件 在哪个选项卡里 奇怪的问题求解 如何编程实现在Delphi的QuickRep中设置打印起止页码范围. 关于光标 AdoConnection如何连接excel文件(.xls)???? 编译错误,简单,送分。 使用DELPHI怎样动态设置计算公式? 怎样把查询后的结果赋值给stringgrid. 怎样保持数据库连接?不自动关闭。 midas的环境配置问题? 在Access建立一数据库表b1,它的第一个字段为N1,设为文本型,该字段值有年份和名称,我只想对年份排序,应该怎么写SQL语句? 高手请指教!!
ShellListView1.SelectedFolder.IsFolder 判断是文件还是目录
ShellListView1.SelectedFolder.PathName 文件名或路径名
需要使用这两个Unit
uses
ShellCtrls, ShellAPI;Implimentationprocedure TForm1.ShellListView1Click(Sender: TObject);
begin
Edit1.Text:= TShellFolder(ShellListView1.Selected.Data).PathName;
end;