TOpenDialog procedure TForm1.Button1Click(Sender: TObject);begin with TOpenDialog.Create(nil) do begin Filter:='Text files (*.txt)|*.txt)|All Files(*.*)|*.*'; if Execute then Memo1.Lines.LoadFromFile(Filename); end;end; 来自为知笔记…
DELPHI - How to use opendialog1 for choosing a folder? On Vista and up you can show a more modern looking dialog using TFileOpenDialog. var OpenDialog: TFileOpenDialog; SelectedFolder: string; ..... OpenDialog := TFileOpenDialog.Create(MainForm); try…