- procedure TForm1.Print1Click(Sender: TObject);
- var wPages, No : Integer;
- begin
- wPages := TXTextControl1.CurrentPages;
- Printer.BeginDoc;
- for No := 1 To wPages do begin
- TXTextControl1.PrintDevice := Printer.Canvas.Handle;
- TXTextControl1.PrintPage(No);
- if No <> wPages then
- Printer.NewPage;
- end;
- Printer.EndDoc;
- end;
复制代码 |