Vcl.FileCtrl.SelectDirectory
描述:显示一个目录的对话框(属于Delphi)
function SelectDirectory(var Directory: string; Options: TSelectDirOpts; HelpCtx: Longint): Boolean;
参数一:存放返回值。可设置当前选择目录,不设置则为程序运行目录。
参数二:[]:目录不可编辑,只能手动选择
[sdAllowCreate]: 目录可编辑,目录不存在不负责创建。 [asAkkiwCreate, sdPerformCreate]:目录可编辑, 目录不存在直接创建。
[asAkkiwCreate, sdPerformCreate, sdPrompt]:目录可编辑,目录不存在提示是否创建,使用时,一般使用此参数。
参数二所指目录:

参数三:帮助按钮0为不显示。 官方示例传入1000,没找到其他
所在单元:Vcl.FileCtrl
代码部分
procedure TForm1.Button_Type1Click(Sender: TObject);
var
Dir: string;
begin
Dir := 'H:\'; //设置初始目录,可不设置
if not SelectDirectory(Dir, [sdAllowCreate, sdPerformCreate, sdPrompt], ) then Exit;
Edit_Path.Text := Dir; end;
---------------------------------------------------------------------------------------------------------------------------------------------
描述:显示一个目录的对话框(属于Windows)
function SelectDirectory(const Caption: string; const Root: WideString; var Directory: string): Boolean;
参数一:标题
参数二:初始选择目录
参数三:返回值。此参数不能和参数二共用一个变量。
代码部分
procedure TForm1.Button_Type2Click(Sender: TObject);
var
Dir, DefDir: string;
begin
DefDir := 'H:\'; //设置初始目录,可不设置
if not SelectDirectory('请选择目录', DefDir, Dir) then Exit;
Edit_Path.Text := Dir;
end;
Vcl.FileCtrl.SelectDirectory的更多相关文章
- delphi 选择文件夹,路径选择,浏览文件夹
选择文件夹,路径选择, 文件夹 资源管理器 推荐 SelectDirectory http://docwiki.embarcadero.com/Libraries/Seattle/en/Vcl.Fi ...
- TDirectory.CreateDirectory 完整、严谨的创建一个目录
描述:创建一个目录,不包含多级目录(多级目录使用System.SysUtils.ForceDirectories,Vcl.FileCtrl.ForceDirectories已过时) procedure ...
- TDirectory.GetCreationTime、TDirectory.SetCreationTime获取和设置文件夹创建时间
使用函数: System.IOUtils.TDirectory.GetCreationTime//获取创建时间 System.IOUtils.TDirectory.SetCreationTime//设 ...
- TDirectory.GetAttributes、TDirectory.SetAttributes获取和设置文件夹属性
使用函数: System.IOUtils.TDirectory.GetAttributes//获取属性 System.IOUtils.TDirectory.SetAttributes//设置属性 注: ...
- 修正png
这是修正+取MD5的方法 function MD5FileTextPng(filename: AnsiString): AnsiString; var buf: ..MAX_PATH - ] of C ...
- Delphi经验总结(3)
------------------------------------------------------- ◇删掉程序自己的exe文件 procedure TForm1.FormClose(Sen ...
- Delphi 资源管理器套件
需要个类似资源管理器的东西, 首先试了下 TDriveComboBox.TDirectoryListBox.TFileListBox, 嘿! Win31 时代的东西, 不是一般地丑. 试了下 Vcl. ...
- DELPHI - How to use opendialog1 for choosing a folder? TOpenDialog, TFileOpenDialog
DELPHI - How to use opendialog1 for choosing a folder? On Vista and up you can show a more modern lo ...
- SelectDirectory使用方法以及EnableTaskWindows
SelectDirectory使用方法 格式 Delphi syntax: On Windows: function SelectDirectory(const Caption: string; co ...
随机推荐
- os4开始CLLocationManager类中不支持locationServicesEnabled属性了
locationServicesEnabled改为类方法 //判断定位服务是否开启 if ([CLLocationManager locationServicesEnabled]) { }
- Windows性能计数器--磁盘性能分析Disk
Physical Disk: 单次IO大小 Avg.Disk Bytes/Read Avg.Disk Bytes/Write IO响应时间 Avg.Disk sec/Read Avg.Disk sec ...
- 利用PS脚本自动删除7天之前建立的目录-方法1!
目前有一个备份目录,目录名称为d:\temp\bak目录,在这目录下,根据备份要求,自动生成了如下目录的列表: 20131012 20131011 20131010 20131009 20131008 ...
- Android音频底层调试-基于tinyalsa
因为Android中默认并没有使用标准alsa,而是使用的是tinyalsa.所以就算基于命令行的測试也要使用libtinyalsa.Android系统在上层Audio千变万化的时候,能够能这些个工具 ...
- Java解惑五:类之谜
本文是依据JAVA解惑这本书,做的笔记.电子书见:http://download.csdn.net/detail/u010378705/7527721 谜题46 函数重载的问题. JAVA重载解析过程 ...
- android开发Proguard混淆与反射
http://charles-tanchao.diandian.com/post/2012-05-24/20118715 由于前面开发数据操作类,所以利用反射,封装了一个BaseDao,本来在平常的时 ...
- mysql strace fsync,fdatasync
mysql> show create table y; +-------+------------------------------------------------------------ ...
- linux Page cache和buffer cache----- systemtap
http://shixm.iteye.com/blog/1724718 http://blog.csdn.net/dianhuiren/article/details/7543886
- oc中的类学习笔记1
1.oc中的类和构造方法 NSAutoreleasePool * pool =[[NSAutoreleasePool alloc] init]; NSAutoreleasePool是一个类,alloc ...
- UVA 10564 - Paths through the Hourglass (dp)
本文出自 http://blog.csdn.net/shuangde800 题目传送门 题意: 给一个相上面的图.要求从第一层走到最下面一层,只能往左下或右下走,经过的数字之和为sum. 问有多少 ...