是想要让用户选择一个目录,在这个目录下存n个文件
 怎么做呢??   万分感谢啊!

解决方案 »

  1.   

    请问是哪个呢? 用savelialog不行的啊
      

  2.   

    Samples面板上的ShellTreeView控件
      

  3.   

    ShellTreeView控件ShellTreeView1.Path;  //返回路径名
      

  4.   

    function SelectPath(const Title: string): string;
    var
      bi: TBrowseInfo;   //uses ShlObj
      IdList: PItemIDList;
    begin
      result := '';
      FillChar(bi, SizeOf(bi), 0);
      bi.hwndOwner := 0;
      bi.lpszTitle := PChar(Title);
      bi.ulFlags := BIF_RETURNONLYFSDIRS{ + BIF_DONTGOBELOWDOMAIN};
      IdList := SHBrowseForFolder(bi);
      if IdList<>nil then
      begin
        SetLength(result, 255);
        SHGetPathFromIDList(IdList, PChar(result));
        result := string(pchar(result));
        if result<>'' then
          if result[Length(result)] <>'\' then
            result := result + '\';
      end;
    end;
      

  5.   

    至于这么麻烦吗?Uses FileCtrlprocedure TForm1.Button1Click(Sender: TObject);
    var path:string;
    begin
        if SelectDirectory('','',Path) then Edit1.Text:=path;
    end;