
正文
vb.net单据打印 vb打印功能
提示:扫一扫查出行【扫一扫了解最新限行尾号】
复制提示
VB.NET怎么实现打印功能啊 呜呜(
利用 printdocument控件
Private Sub Button1_Click(sender As System.Object, e As System.EventArgs) Handles Button1.Click
PrintDocument1.Print()
End Sub
Private Sub PrintDocument1_PrintPage(sender As System.Object, e As System.Drawing.Printing.PrintPageEventArgs) Handles PrintDocument1.PrintPage
Dim stringFont As New Font("Arial", 16)
Dim rectDraw As New RectangleF(e.MarginBounds.Left, e.MarginBounds.Top, e.MarginBounds.Width, e.MarginBounds.Height)
Dim strFormat As New StringFormat
Dim s As String
s = "print word" '打印vb.net单据打印的内容
e.Graphics.DrawString(s, stringFont, Brushes.AliceBlue, rectDraw, strFormat)
End Sub
相关问答
Q1: vb.net 打印功能
可以把数据导出到EXCELvb.net单据打印,然后使用EXCEL进一步处理后使用。
也可以做成vb报表(VB自带有)。
先设置报表格式vb.net单据打印,打印时向报表传递数据就可以vb.net单据打印了。
Q2: VS2005如何用VB.NET代码实现打印功能
有个PrintDocument控件,可以实现打印。。。
MSDN原话:
使用 PrintDocument 组件
涉及 PrintDocument 组件的两种主要情况是:
简单的打印作业,如打印单个文本文件。在这种情况下,应将 PrintDocument 组件添加到 Windows 窗体,然后在 PrintPage 事件处理程序中添加打印文件的编程逻辑。 该编程逻辑应以使用 Print 方法打印文档结束。
此方法向打印机发送一个 Graphics 对象,该对象包含在 PrintPageEventArgs 类的 Graphics 属性中。
有关如何使用 PrintDocument 组件打印文本文档的示例,请参见
如何:打印 Windows 窗体中的多页文本文件。
更为复杂的打印作业,如想要重新使用已编写的打印逻辑的情况。
在这种情况下,应从 PrintDocument 组件派生一个新组件,并重写
(请参见 Visual Basic 的 重写或 C# 的 重写) PrintPage 事件。
将 PrintDocument 组件添加到窗体后,它出现在 Windows 窗体设计器底部的栏中
Q3: vb.net2010中,如何实现单据打印,请各位高手提供一些源码和一些教程,万分感谢!
vb 里有printer对象,打印很简单。
vb.net 升级为
Microsoft.VisualBasic.PowerPacks.Printing.Compatibility.VB6 .Printer
这个没用过,你研究下
vb.net单据打印的介绍就聊到这里吧,感谢你花时间阅读本站内容,更多关于vb打印功能、vb.net单据打印的信息别忘了在本站进行查找喔。







