我用Printer和API函数DrawText打印报表,不调用Printer.print 方法
直接用 DrawText printer.hdc ..... 不能实现打印,为什么?
Printer.Orientation = vbPRORLandscape
Printer.FontBold = True
Printer.FontItalic = True
Printer.FontSize = 10
'printer.print spc(1)(添加内容)
Printer.CurrentX = 500
Printer.CurrentY = 6000
rcBounds.Left = CLng(2000 / dbTwipsPerPixelX)
rcBounds.Top = CLng(6000 / dbTwipsPerPixelY)
rcBounds.Right = rcBounds.Left + CLng(4000 / dbTwipsPerPixelX)
rcBounds.Bottom = rcBounds.Top + CLng(1000 / dbTwipsPerPixelY)
DrawText Printer.hdc, "I'm a good man!", -1, rcBounds, DT_RIGHT
Printer.EndDoc
以上代码前面加上printer.print spc(1) 或其他的调用printer.print的方法就能
用DrawTex实现打印?why
直接用 DrawText printer.hdc ..... 不能实现打印,为什么?
Printer.Orientation = vbPRORLandscape
Printer.FontBold = True
Printer.FontItalic = True
Printer.FontSize = 10
'printer.print spc(1)(添加内容)
Printer.CurrentX = 500
Printer.CurrentY = 6000
rcBounds.Left = CLng(2000 / dbTwipsPerPixelX)
rcBounds.Top = CLng(6000 / dbTwipsPerPixelY)
rcBounds.Right = rcBounds.Left + CLng(4000 / dbTwipsPerPixelX)
rcBounds.Bottom = rcBounds.Top + CLng(1000 / dbTwipsPerPixelY)
DrawText Printer.hdc, "I'm a good man!", -1, rcBounds, DT_RIGHT
Printer.EndDoc
以上代码前面加上printer.print spc(1) 或其他的调用printer.print的方法就能
用DrawTex实现打印?why
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货