vb.net直接打印 vb 打印輸出

vb.net如何實(shí)現(xiàn)打印整個panel的內(nèi)容(打印機(jī)打印)

使用jquery.print插件

西塞山ssl適用于網(wǎng)站、小程序/APP、API接口等需要進(jìn)行數(shù)據(jù)傳輸應(yīng)用場景,ssl證書未來市場廣闊!成為成都創(chuàng)新互聯(lián)的ssl證書銷售渠道,可以享受市場價(jià)格4-6折優(yōu)惠!如果有意向歡迎電話聯(lián)系或者加微信:18980820575(備注:SSL證書合作)期待與您的合作!

我用得jQuery.print, version 1.3.2。

頁面上調(diào)用代碼如下: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.NET中怎么在圖片上直接輸出文字。向VB中有Print的方法

兩種方法:

圖片框上蓋個Label 向其輸入內(nèi)容。

載入圖片,通過內(nèi)存直接?DrawImage繪制個新圖,然后在圖上蓋文字。最后賦值給圖片框。

VB6的print 實(shí)質(zhì)是向圖片框打印文字,不管有無圖都能在上面Print. 考慮速度和實(shí)現(xiàn)難度問題,如果純粹顯示,最好直接蓋個Label最簡單。第二種方法 需要考慮文字大小、顏色、坐標(biāo)定位等等。如果一行文字顯示不下,不會自動換行,得自己切。

VB.NET怎么實(shí)現(xiàn)打印功能啊 嗚嗚(

利用 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" '打印的內(nèi)容

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

End Sub

vb.net 打印功能

可以把數(shù)據(jù)導(dǎo)出到EXCEL,然后使用EXCEL進(jìn)一步處理后使用。

也可以做成vb報(bào)表(VB自帶有)。

先設(shè)置報(bào)表格式,打印時向報(bào)表傳遞數(shù)據(jù)就可以了。

VS2005如何用VB.NET代碼實(shí)現(xiàn)打印功能

有個PrintDocument控件,可以實(shí)現(xiàn)打印。。。

MSDN原話:

使用 PrintDocument 組件

涉及 PrintDocument 組件的兩種主要情況是:

簡單的打印作業(yè),如打印單個文本文件。在這種情況下,應(yīng)將 PrintDocument 組件添加到 Windows 窗體,然后在 PrintPage 事件處理程序中添加打印文件的編程邏輯。 該編程邏輯應(yīng)以使用 Print 方法打印文檔結(jié)束。

此方法向打印機(jī)發(fā)送一個 Graphics 對象,該對象包含在 PrintPageEventArgs 類的 Graphics 屬性中。

有關(guān)如何使用 PrintDocument 組件打印文本文檔的示例,請參見

如何:打印 Windows 窗體中的多頁文本文件。

更為復(fù)雜的打印作業(yè),如想要重新使用已編寫的打印邏輯的情況。

在這種情況下,應(yīng)從 PrintDocument 組件派生一個新組件,并重寫

(請參見 Visual Basic 的 重寫或 C# 的 重寫) PrintPage 事件。

將 PrintDocument 組件添加到窗體后,它出現(xiàn)在 Windows 窗體設(shè)計(jì)器底部的欄中

VB.NET 打印問題。

先拖過來控件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

調(diào)用下面語句可直接用默認(rèn)打印機(jī)打印出來:

PrintDocument1.Print()

文章標(biāo)題:vb.net直接打印 vb 打印輸出
網(wǎng)頁路徑:http://muchs.cn/article16/docoggg.html

成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供網(wǎng)站策劃、網(wǎng)站設(shè)計(jì)公司、品牌網(wǎng)站制作、企業(yè)建站、移動網(wǎng)站建設(shè)、動態(tài)網(wǎng)站

廣告

聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請盡快告知,我們將會在第一時間刪除。文章觀點(diǎn)不代表本網(wǎng)站立場,如需處理請聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時需注明來源: 創(chuàng)新互聯(lián)

成都網(wǎng)站建設(shè)