VB.NET 打印问题。
VB.NET打印需要打印一些字符串的内容!如:dimaasStringa="abcd"现在就是想要直接把:A变量给打印出来!!有没谁会,帮下~~是打印到打印机里面噢~~不...
VB.NET 打印 需要打印一些字符串的内容!
如: dim a as String
a="abcd"
现在就是想要直接把:A 变量给打印出来!!
有没谁会,帮下~~
是打印到打印机里面噢~~
不是DEBUG 展开
如: dim a as String
a="abcd"
现在就是想要直接把:A 变量给打印出来!!
有没谁会,帮下~~
是打印到打印机里面噢~~
不是DEBUG 展开
2个回答
推荐于2017-09-20
展开全部
先拖过来控件PrintDocument1,然后双击PrintDocument1,在它的PrintPage事件中加入代码如下:
Private Sub PrintDocument1_PrintPage(ByVal sender As System.Object, ByVal e As System.Drawing.Printing.PrintPageEventArgs) Handles PrintDocument1.PrintPage
dim a as String
a="abcd"
Dim mypen As Pen = New Pen(Color.Blue, 2)
e.Graphics.DrawString(a, New Font("宋体", 20), New Pen(Color.Black, 1).Brush, 30, 30)
End Sub
调用下面语句可直接用默认打印机打印出来:
PrintDocument1.Print()
Private Sub PrintDocument1_PrintPage(ByVal sender As System.Object, ByVal e As System.Drawing.Printing.PrintPageEventArgs) Handles PrintDocument1.PrintPage
dim a as String
a="abcd"
Dim mypen As Pen = New Pen(Color.Blue, 2)
e.Graphics.DrawString(a, New Font("宋体", 20), New Pen(Color.Black, 1).Brush, 30, 30)
End Sub
调用下面语句可直接用默认打印机打印出来:
PrintDocument1.Print()
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询