Delphi选择文件夹

uses FileCtrl; function SelectDirectory(var Directory: string; // 英文对话框 Options: TSelectDirOpts; HelpCtx: Longint): Boolean; overload; function SelectDirectory(const Caption: string; // 中文对话框 const Root: WideString; var Directory: string): Boolean; overload; //以下是Delphi帮助的Demo: uses FileCtrl; const SELDIRHELP = 1000; procedure TForm1.Button1Click(Sender: TObject); var Dir: string; begin Dir := 'C:/MYDIR'; // 缺省为C:/MYDIR if SelectDirectory(Dir, [sdAllowCreate, sdPerformCreate, sdPrompt],SELDIRHELP) then Label1.Caption := Dir; // Dir返回选择的文件夹 end;

你可能感兴趣的:(Delphi)