Revision 2 of 2, by FTurtle on 5-6-2020. The page as it is now.
TOpenDialog/zh CN
TOpenDialog
就是打开文件的弹窗,在 Dialogs tab 的 Component Palette.
procedure TForm1.Button1Click(Sender: TObject);
var
s:String;
begin
try
OpenDialog1.Execute;
s := OpenDialog1.FileName;
Form1.Caption := s;
Memo1.Lines.LoadFromFile(s);
except
on E: Exception do
//ShowMessage( 'Error: '+ E.ClassName + #13#10 + E.Message );
ShowMessage('忘记选择文件或者选择的文件不存在');
end;
end;参考资料
From the Free Pascal wiki, page "TOpenDialog/zh CN", as the Internet Archive kept it on 2025-03-24, last changed on 2020-05-07. Copyright stays with the author who wrote it, according to the old wiki's Licensing page. If you have concerns about this material, message the admin.
