• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

delphi选择文件夹,路径选择,浏览文件夹

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

选择文件夹,路径选择,

文件夹

资源管理器

推荐  SelectDirectory

 http://docwiki.embarcadero.com/Libraries/Seattle/en/Vcl.FileCtrl.TSelectDirFileDlgOpts

Vcl.FileCtrl.hpp

if (!SelectDirectory("请选择目录","",DaoPath))
{
return;
}

 

SelectDirectory

#include "FileCtrl.hpp"
 
const SELDIRHELP = 1000;
void __fastcall TForm1::Button1Click(TObject *Sender)
{
  String Dir = "C:\\Program Files\\CodeGear";
  if (SelectDirectory(Dir, TSelectDirOpts() << sdAllowCreate << sdPerformCreate << sdPrompt,SELDIRHELP))
    Label1->Caption = Dir;
}

 

SHBrowseForFolder

http://bbs.csdn.net/topics/390017304

 

Vcl.Shell.ShellCtrls

TShellComboBox

TShellTreeView

TShellListView

 

文件名:

ShellListView1.Folders[ShellListView1.ItemIndex].PathName

ShellTreeView.SelectedFolder.PathName;

 

//2018.1.18

http://docwiki.embarcadero.com/Libraries/Tokyo/en/Vcl.FileCtrl.TSelectDirFileDlgOpts

能粘贴路径,选择路径,快速输入

procedure TForm.Button4Click(Sender: TObject);
var
  astrPath: tarray<string>; // 用户选定后的目录
begin
  //TSelectDirFileDlgOpt.sdHidePinnedPlaces
  if (SelectDirectory('请选择文件保存的路径', astrPath,  [sdNoDereferenceLinks])) then
  begin
    self.Caption := astrPath[0];
  end;

end;

 

 

 

 

procedure TForm.Button1Click(Sender: TObject);
const
  SELDIRHELP = 1000;
var
  Dir: string;
begin
  Dir := 'C:\Windows';
  if Vcl.FileCtrl.SelectDirectory(Dir, [sdAllowCreate, sdPerformCreate, sdPrompt], SELDIRHELP) then
    self.Caption := Dir;
end;

 

参考写的很细,学习

https://www.cnblogs.com/huangygdelphi/articles/1969357.html

 
                    
            
                

鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Delphi中DLL的建立和调用发布时间:2022-07-18
下一篇:
Delphi下操作INI文件发布时间:2022-07-18
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap