如何在vb.net表单上使用“打印"按钮? [英] How do I use print button on my vb.net form?

查看:78
本文介绍了如何在vb.net表单上使用“打印"按钮?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


我要在vb.net的表单上附加一个打印按钮,但是我对
的后端编程一无所知 打印按钮.
如果有谁可以帮忙,请先谢谢.
请提供打印按钮的详细代码.
我要打印我的页面.

Hi,
I am going to attach a print button on my form in vb.net but I don''t have any idea about the back end programming of
print button.
If any one can help then thanks in advance.
Please give a detailed code for print button.
I want to print my page.

推荐答案

CP文章 [ ^ ]关于打印.
否则...

[
CP Article[^] about printing.
Otherwise...

This[^] may help.


尝试
http://www.startvbdotnet.com/controls/printdialog.aspx [在Visual Basic .NET中打印 [
Try
http://www.startvbdotnet.com/controls/printdialog.aspx[^]
Printing in Visual Basic .NET[^]


''名称空间
导入CrystalDecisions.Shared
导入CrystalDecisions.CrystalReports.Engine


''粘贴您的打印按钮
''您可以通过ReportDocument的PrintOptions属性更改更多打印选项
将报表变暗为新的ReportDocument()
report.Load("C:\ My Crystal Reports \ Report Name.rpt")
report.PrintToPrinter(1,True,0,0)
report.Close()

"之后,您要做的就是设计水晶报表
''Name Space
Imports CrystalDecisions.Shared
Imports CrystalDecisions.CrystalReports.Engine


''paste in your print button
''You can change more print options via PrintOptions property of ReportDocument
Dim report As New ReportDocument()
report.Load("C:\My Crystal Reports\Report Name.rpt")
report.PrintToPrinter(1, True, 0, 0)
report.Close()

''after that all you need to do is design your crystal Report


这篇关于如何在vb.net表单上使用“打印"按钮?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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