网创优客建站品牌官网
为成都网站建设公司企业提供高品质网站建设
热线:028-86922220
成都专业网站建设公司

定制建站费用3500元

符合中小企业对网站设计、功能常规化式的企业展示型网站建设

成都品牌网站建设

品牌网站建设费用6000元

本套餐主要针对企业品牌型网站、中高端设计、前端互动体验...

成都商城网站建设

商城网站建设费用8000元

商城网站建设因基本功能的需求不同费用上面也有很大的差别...

成都微信网站建设

手机微信网站建站3000元

手机微信网站开发、微信官网、微信商城网站...

建站知识

当前位置:首页 > 建站知识

vb点虐 如何打印 vb打印功能

VB.NET怎么实现打印功能啊 呜呜(

利用 printdocument控件

目前创新互联公司已为1000+的企业提供了网站建设、域名、网络空间、绵阳服务器托管、企业网站设计、桐庐网站维护等服务,公司将坚持客户导向、应用为本的策略,正道将秉承"和谐、参与、激情"的文化,与客户和合作伙伴齐心协力一起成长,共同发展。

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" '打印的内容

e.Graphics.DrawString(s, stringFont, Brushes.AliceBlue, rectDraw, strFormat)

End Sub

vb点虐 如何实现打印DataGridView1里的内容,求源码

使用 PrintDocument 控件的 Print() 方法可以打印指定对象中的内容,参考代码如下:

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click

PrintDocument1.Print()

End Sub

Private Sub PrintDocument1_PrintPage(ByVal sender As System.Object, ByVal e As System.Drawing.Printing.PrintPageEventArgs) Handles PrintDocument1.PrintPage

Dim bm As New Bitmap(Me.DataGridView1.Width, Me.DataGridView1.Height)

DataGridView1.DrawToBitmap(bm, New Rectangle(0, 0, Me.DataGridView1.Width, Me.DataGridView1.Height))

e.Graphics.DrawImage(bm, 0, 0)

End Sub

vb点虐 如何实现打印整个panel的内容(打印机打印)

使用jquery.print插件

我用得jQuery.print, version 1.3.2。

页面上调用代码如下:PrintArea就是你panel的ID....

script src="~/Scripts/jQuery.print.js"/script

script

function printarea() {

$("#PrintArea").print({

globalStyles: true,

mediaPrint: false,

stylesheet: null,

noPrintSelector: ".no-print",

iframe: true,

append: null,

prepend: null,

manuallyCopyFormValues: true,

deferred: $.Deferred()

});

}

/script

a class="btn btn-success" onclick="printarea()"打印/a


本文标题:vb点虐 如何打印 vb打印功能
本文网址:http://bjjierui.cn/article/ddjdpsh.html

其他资讯