function SelectDirectory(const Caption: string; const Root: WideString; out Directory: string): Boolean;
SelectDirectory彈出對話框讓用戶選擇目錄,不改變目錄的鍵值,在linux和windows中格式有所不同,
caption標題是長字符串
const Root指定瀏覽的根目錄
out Directory返回所選目錄
ShowHidden標識所選目錄是否顯示隱藏子目錄
例:
var
Save_Cursor: TCursor;
s : string;
begin
Save_Cursor := Screen.Cursor;
Screen.Cursor := crHourglass;
try
if SelectDirectory('請選擇文件夾:','',s) then
begin
edtFileName.Text:=s;
end;
finally
Screen.Cursor := Save_Cursor;
end;
end;