WINDOWS的浏览文件夹对话框

//SelectDirectory在Delphi中定位文件夹位置  

function SelectDirectory(var Directory: string; Options: TSelectDirOpts; HelpCtx: Longint): Boolean;
function SelectDirectory(const Caption: string; const Root: WideString; var Directory: string): Boolean;


uses FileCtrl;
procedure TForm1.Button1Click(Sender: TObject);
var
  sDir:string;
begin
  if SelectDirectory('Path','',sDir) then
  begin
     ComboBox1.Text:=sDir;
  end;
end;


uses FileCtrl;
procedure TForm1.Button1Click(Sender: TObject);
var
  sDir:string;
  const   SELDIRHELP = 1000;
begin
  if SelectDirectory(sDir,[sdAllowCreate, sdPerformCreate, sdPrompt],SELDIRHELP) then
  begin
     ComboBox1.Text:=sDir;
  end;
end;







posted @ 2012-06-02 10:12  XE2011  阅读(234)  评论(0编辑  收藏  举报