vb中如何才能实现打印预览类似的功能
1个回答
展开全部
方法:传送正文和图形给 Printer 对象,再用 NewPage 和 EndDoc 方法打印。,代码如下:
Option Explicit
Private y As Integer
Private x As Integer
Private txt As String
Private fnt As Integer
Private dd As Variant
'打印函数
Public Function prnt(x As Variant, y As Variant, fnt As Variant, txt As Variant)
Printer.CurrentX = x
Printer.CurrentY = y
Printer.FontSize = fnt
Printer.Print txt
End Function
Private Sub cmdPrint_Click()
fnt = 18
y = 300
Option Explicit
Private y As Integer
Private x As Integer
Private txt As String
Private fnt As Integer
Private dd As Variant
'打印函数
Public Function prnt(x As Variant, y As Variant, fnt As Variant, txt As Variant)
Printer.CurrentX = x
Printer.CurrentY = y
Printer.FontSize = fnt
Printer.Print txt
End Function
Private Sub cmdPrint_Click()
fnt = 18
y = 300
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询