在新行打印 [英] Print at New Line

查看:55
本文介绍了在新行打印的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

卢比获得的最大字符数是55.仅一行是不够的.我要继续下一行 卢比.怎么写这段代码.我正在使用此代码:

Rupees get maximum character is 55. It's not enough in one line. I want continue next line for Rupees. How write this code. I'm using this code :

Private Sub myPrintDoc_PrintPage(sender As Object, e As PrintPageEventArgs) Handles myPrintDoc.PrintPage
Dim shopnameX As Integer = 10, shopnameY As Integer = 20

        Dim strfomart As New StringFormat()
        Dim StrRight As New StringFormat()
        Dim StrLeft As New StringFormat()
        strfomart.Alignment = StringAlignment.Center
        StrRight.Alignment = StringAlignment.Far
        StrLeft.Alignment = StringAlignment.Near

        Dim dashValues As Single() = {5, 2, 5, 2}
        Dim blackPen As New Pen(Color.Black, 1)
        blackPen.DashPattern = dashValues
        Dim i As Integer, j As Integer


                    e.Graphics.DrawString(Rupees, New Font("Courier New", 12), Brushes.Black, New PointF(shopnameX + 70, shopnameY + 540))
                    e.Graphics.DrawString("Total Amount:", New Font("Courier New", 12), Brushes.Black, New PointF(730, shopnameY + 540), StrRight)
                    e.Graphics.DrawString("    Discount:", New Font("Courier New", 12), Brushes.Black, New PointF(730, shopnameY + 560), StrRight)
                    e.Graphics.DrawString("  Net Amount:", New Font("Courier New", 12), Brushes.Black, New PointF(730, shopnameY + 580), StrRight)
                    e.Graphics.DrawString(TotalAmount, New Font("Courier New", 12), Brushes.Black, New PointF(840, shopnameY + 540), StrRight)
                    e.Graphics.DrawString(Discount, New Font("Courier New", 12), Brushes.Black, New PointF(840, shopnameY + 560), StrRight)
                    e.Graphics.DrawString(NetAmount, New Font("Courier New", 12), Brushes.Black, New PointF(840, shopnameY + 580), StrRight)
                    e.Graphics.DrawString("Entry By: " + Entry, New Font("Courier New", 12), Brushes.Black, New PointF(shopnameX + 70, shopnameY + 580))

End Sub



dopenoinam

dopenoinam

推荐答案

卢比获得的最大字符数是55.仅一行是不够的.我要继续下一行 卢比.怎么写这段代码.我正在使用此代码:

Rupees get maximum character is 55. It's not enough in one line. I want continue next line for Rupees. How write this code. I'm using this code :

您需要使用StringFormat对象和边界矩形来绘制字符串.StringFormat使您可以指定如何将字符串换行到新行,并且矩形指示将在其中绘制文本的空间.参见:
https://msdn.microsoft.com/en-us/library/21kdfbzs (v = vs.110).aspx

You need to draw the string using a StringFormat object and a bounding rectangle. The StringFormat enables you to nominate how the string will be wrapped to a new line, and the rectangle indicates the space that the text will be drawn within. See:
https://msdn.microsoft.com/en-us/library/21kdfbzs(v=vs.110).aspx


这篇关于在新行打印的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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