主题:怎么实现打印功能?
leojon
[专家分:0] 发布于 2005-12-21 00:27:00
用vb.NET怎么编写实现打印功能的呢?
代码是怎么写的呀?需要添加那些控件?
回复列表 (共2个回复)
沙发
自由鼠 [专家分:50] 发布于 2005-12-27 11:09:00
Sub pd_print(ByVal sender As Object, ByVal e As PrintPageEventArgs)
Dim fnt, fnt1 As Font
fnt = New Font("黑体", 13)
fnt1 = New Font("黑体", 15)
e.PageSettings.Margins.Top = 0
e.PageSettings.Margins.Left = 0
e.Graphics.DrawString("中国", fnt, Brushes.Black, 22, ycd)
e.HasMorePages = False
fnt.Dispose()
End Sub
Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim pd As New PrintDocument
AddHandler pd.PrintPage, AddressOf Me.pd_print
pd.Print()
End Sub
End Class
板凳
leojon [专家分:0] 发布于 2005-12-30 00:19:00
谢谢这位大厦1
我来回复