Hasmorepages PrintPageEventArgs 属性究竟有什么作用? [英] What does Hasmorepages PrintPageEventArgs property do exactly?

查看:24
本文介绍了Hasmorepages PrintPageEventArgs 属性究竟有什么作用?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想了解 Hasmorepages PrintPageEventArgs 属性是什么,为什么要使用它以及它是如何工作的.

I am trying to understand what Hasmorepages PrintPageEventArgs property is, why would you use it and how does it work.

MSDN Library 并没有很好的解释.他们只是说,如果您将其设置为 true,则会再次调用 printpage 事件.这是否意味着事件在不离开的情况下自行循环或离开并再次调用自身或依赖您再次调用printpage事件?

MSDN Library doesn't really have a good explanation. All they say is that if you set it to true, printpage event is called again. Is that mean the event loops on itself without leaving or leaves and calls itself again or relies on you to call the printpage event again?

我只是想了解 PrintPageEventArgs.hasmorepages 属性.任何提示或帮助将不胜感激.

I am just trying to understand PrintPageEventArgs.hasmorepages property. Any hints or help will be greatly appreciated.

谢谢,

推荐答案

HasMorePages 是作为事件参数接收的 PrintPageEventArgs 的布尔属性.如果要打印更多页面,则在打印当前页面后将其设置为 True,如果当前页面是最后一页,则将其设置为 False.

HasMorePages is a boolean property of the PrintPageEventArgs you receive as a parameter of the event. You set it to True after printing the current page if there are more pages to be printed, or False if the current page is the last one.

事件总是由框架中的某些东西为您调用,并且永远不应该由您直接调用.它们是事件,这意味着它们被派去是为了告诉您发生了一些事情,并让您有机会做出回应或反应.

Events are always called for you by something in the framework, and are never supposed to be called directly by you. They are events, which mean they're dispatched to tell you that something has happened and give you a chance to respond or react.

如果设置为TruePrintPage 事件会自动再次调用;你不叫它自己.(这正是 MSDN 文档所说的:如果您将其设置为 true,则打印页事件 再次被调用.它没有说您需要再次调用它- 它说再次被调用.)

If you set it to True, the PrintPage event is called again automatically; you do not call it yourself. (That's exactly what the MSDN documentation says: If you set it to true, the printpage event is called again. It doesn't say you'll need to call it again - it says is called again.)

ev.HasMorePages := DoYouHaveMorePagesToPrint;

有关事件的 VB.NET 示例以及如何使用 ev.HasMorePages,请参阅 PrintDocument 的 MSDN 文档.有关 PrintPageEventArgs 的信息,请参阅 此 MSDN 页面,其中包含指向 PrintPageEventArgs 的成员(包括 HasMorePages).

For a VB.NET example of the event and how to use ev.HasMorePages, see the MSDN documentation for PrintDocument. For info on PrintPageEventArgs, see this MSDN page, which has a link to the members of PrintPageEventArgs (including HasMorePages).

这篇关于Hasmorepages PrintPageEventArgs 属性究竟有什么作用?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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