如何使用PrintDocument打印多个页面 [英] How to print more than one page using PrintDocument

查看:379
本文介绍了如何使用PrintDocument打印多个页面的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试打印一组控件.它由一些标签,两个面板和一个Picturebox组成.单页效果很好

但是我无法弄清楚如何分别在不同的页面上打印这些控件.就像我要在第一页上打印标签,在第二页上的图片框以及在第三页上的两个面板一样.


我认为也许e.hasmorepages属性没有做任何事情.

请让我知道此

I am trying to print a set of controls. It consists of some labels ,two panels and a Picturebox. It works fine for a single page

But I am not able to figure out how to print these controls seperately on different pages.Like I want to print the labels on first page ,the picturebox on second page and the two panels on third page.


I think perhaps it has t do something with e.hasmorepages property.

Please let me konw the solution for this

推荐答案

ChetanChaudhary的解决方案:
ChetanChaudhary wrote:

我认为也许它与e.hasmorepages属性无关.

I think perhaps it has t do something with e.hasmorepages property.



它与它有关.从打印方法返回时,需要设置e.hasmorepages以指示是否有更多数据要打印.如果将其设置为false,则打印类将假定您已完成并且不会再次调用您.



It has everything to do with it. When you return from your print method you need to set e.hasmorepages to indicate whether there is more data to be printed. If you set it to false then the print class assumes you have finished and will not call you again.


这篇关于如何使用PrintDocument打印多个页面的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆