开发者

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:

        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. Wh开发者_StackOverflow社区y did they drop the nearly automatic printing that was in VB6 with the CommonDialog?


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

Alex.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜