编写VB打印控制程序的几点心得
If ActiveForm Is Nothing Then Exit Sub
With dlgCommonDialog ‘打印机公用对话框
.DialogTitle = "打印"
.CancelError = True
.Flags = 1
Printer.FontSize = dlgCommonDialog.FontSize
‘将打印机公用对话框设置的字体大小传递给打印机
.ShowPrinter ‘ 在屏幕上显示【打印】公用对话框
If Err <> MSComDlg.cdlCancel Then
Printer.FontTransparent = False ‘初始化打印的字体为不透明
SetPrinterScale Myform ‘匹配打印机的缩放属性与窗体的属性