怎么设置目录delphi

来源:百度知道 编辑:UC知道 时间:2024/06/08 09:05:22
像安装程序那样,在安装时可以选目录。
点一下就出来对话框选目录,然后在旁边的文本框里可以显示选好的路径,delphi里怎么做的。

问题补充:

安装软件时,总会有一个文本框显示软件默认的安装路径,旁边还有一个小按钮,点一下可以更改。
我要这样的
在上面加了这个,uses filectrl
还是有错:
[Warning] Unit1.pas(7): Unit 'FileCtrl' is specific to a platform
[Warning] Unit1.pas(7): Unit 'FileCtrl' is specific to a platform
[Error] Unit1.pas(7): Identifier redeclared: 'FileCtrl'

嗯,知道了,,弄好了

先uses filectrl

procedure TForm1.Button1Click(Sender: TObject);
var path:string;
begin
if selectdirectory('请选择文件夹','',path) then Edit1.Text:=path;
end;

filectrl重复引用了。那你就不用uses filectrl,你的uses里面已经有一个filectrl在了