with OpenDialog1 do
Options := Options +
[ofAllowMultiSelect, ofFileMustExist];
OpenDialog1.Filter :=
'Text files (*.txt)|*.txt|All files (*.*)|*.*';
if OpenDialog1.Execute then
ShowMessage(OpenDialog1.FileName);
procedure TForm1.btnFromCodeClick(Sender: TObject);
var OpenDlg : TOpenDialog;
begin OpenDlg := TOpenDialog.Create(Self);
{set options here...}
if OpenDlg.Execute then begin
{code to do something here}
end;
OpenDlg.Free;
end;
procedure TForm1.btnOpenClick(Sender: TObject);
begin
if OpenDialog1.Execute then begin
Form1.Caption := OpenDialog1.FileName;
Memo1.Lines.LoadFromFile
(OpenDialog1.FileName);
Memo1.SelStart := 0;
end;
end;