请问关于NEWPAGE的使用方法???打印方法的.我在线等.谢谢

h_x_k 2003-06-25 02:51:24
我看了下BEGINDOC是PAGE为1
ENDDOC后PAGE就是0了.现在我要发作业到打印机上但是不知道该如何控制PAGE的增加

因为打印的内容有点长.一页打不下.请教高手

谢谢
...全文
100 3 打赏 收藏 转发到动态 举报
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
outer2000 2003-06-25
  • 打赏
  • 举报
回复
with Printer do
begin
BeginDoc;
for I := Start to Stop do
begin
PageControl1.Pages[I].PaintTo(Handle, 10, 10);
if I <> Stop then
NewPage;///注意这里//来自DELPHI的HELP
end;
EndDoc;
outer2000 2003-06-25
  • 打赏
  • 举报
回复
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[I].PaintTo(Handle, 10, 10);
if I <> Stop then
NewPage;
end;
EndDoc;
end;
end;

end;
h_x_k 2003-06-25
  • 打赏
  • 举报
回复
知道的请帮帮忙啊

5,388

社区成员

发帖
与我相关
我的任务
社区描述
Delphi 开发及应用
社区管理员
  • VCL组件开发及应用社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧