[英]How to print a newline in c#
Using a PrintDocument
and the PrintPage
event, Environment.Newline
is ignored, so the only way I found to print a newline is: 使用
PrintDocument
和PrintPage
事件,将忽略Environment.Newline
,因此我发现打印换行符的唯一方法是:
line = string.Empty;
yPos = topMargin + count * printFont.GetHeight(ev.Graphics)
ev.Graphics.DrawString(line, printFont, Brushes.Black, leftMargin, _
yPos, New StringFormat())
Is there a simpler way to print a newline? 有没有更简单的方式打印换行符?
As a side comment, printing with .Net seems to have regressed to an unnecessarily complex task. 附带说明一下,使用.Net进行打印似乎已退到了不必要的复杂任务。 Why did they drop the nearly automatic printing that was in VB6 with the
CommonDialog
? 他们为什么使用
CommonDialog
放弃VB6中几乎自动打印的功能?
This book helped me a lot on a printing task, hope you can find what you are looking for here. 这本书对印刷任务有很大帮助,希望您能在这里找到所需的内容。
http://www.merrioncomputing.com/Programming/Printing-a-NET-developers-guide-Part1.pdf http://www.merrioncomputing.com/Programming/Printing-a-NET-developers-guide-Part1.pdf
Alex. 亚历克斯
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.