怎样在win98中利用Delphi4编程,打印结束后不自动换页(100分)

  • 主题发起人 主题发起人 何诗兴
  • 开始时间 开始时间

何诗兴

Unregistered / Unconfirmed
GUEST, unregistred user!
我在用DELPHI4做一个打印程序时,希望每次打印结束后,打印机纸张不换页,下次打印时接下去打印,请问如何实现?我用quickrep和Tprinter试都不行.
 
This example uses a button, a Page Control, and a Print dialog box on a form. When the user clicks the button, the print dialog is displayed. The user can select any subset of the pages in the page control for printing. The selected pages are then printed.
To run this example successfully, you must add the Printers unit to the uses clause of your unit.

procedure TForm1.Button1Click(Sender:TObject);

var
I, Start, Stop: Integer;
begin
PrintDialog1.Options := [poPageNums, poSelection];
PrintDialog1.FromPage := 1;
PrintDialog1.MinPage := 1;
PrintDialog1.ToPage := PageControl1.PageCount;
PrintDialog1.MaxPage := PageControl1.PageCount;
if PrintDialog1.Execute then
begin
{ determine the range the user wants to print }
with PrintDialog1 do
begin
if PrintRange = prAllPages then

begin
Start := MinPage - 1;
Stop := MaxPage - 1;
end
else if PrintRange = prSelection then
begin
Start := PageControl1.ActivePage.PageIndex;
Stop := Start;
end
else { PrintRange = prPageNums }
begin
Start := FromPage - 1;
Stop := ToPage - 1;
end;
end;
{ now, print the pages }

with Printer do
begin
BeginDoc;
for I := Start to Stop do
begin
PageControl1.Pages.PaintTo(Handle, 10, 10);
if I <> Stop then
NewPage;
end;
EndDoc;
end;
end;

end;
 
接受答案了.
 
后退
顶部