Habe dir ein paar Änderungen angebracht:
Delphi-Quellcode:
unit Unit1;
interface
procedure TForm1.Button2Click(Sender: TObject);
begin
Close;
// warum Application.Terminate?
end;
procedure TForm1.Button1Click(Sender: TObject);
begin
...
Printer.beginDoc;
// verhindert evtl. verschachtelten print job
SpeedButton1.Enabled :=
not Printer.Printing;
...
Printer.endDoc;
SpeedButton1.Enabled :=
not Printer.Printing;
...
end;
end.
marabu