printercontrol.cls

来自「金融机构用于银行承兑票台帐的登记以及统计打印各种报表」· CLS 代码 · 共 45 行

CLS
45
字号
VERSION 1.0 CLASS
BEGIN
  MultiUse = -1  'True
  Persistable = 0  'NotPersistable
  DataBindingBehavior = 0  'vbNone
  DataSourceBehavior  = 0  'vbNone
  MTSTransactionMode  = 0  'NotAnMTSObject
END
Attribute VB_Name = "PrinterControl"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = True
Attribute VB_PredeclaredId = False
Attribute VB_Exposed = False
'设置打印方向的专用模块
Private PageDirection As Integer
 
Public Sub ChngOrientationLandscape()
If Printer.Orientation = 1 Then
Fangxiang = True
ElseIf Printer.Orientation = 2 Then
Fangxiang = False
End If
PageDirection = 2
 Call SetOrientation(DMDUP_SIMPLEX, PageDirection)
End Sub
Public Sub ReSetOrientation()
If Fangxiang = True Then
 PageDirection = 1
Else
 PageDirection = 2
End If
Call SetOrientation(DMDUP_SIMPLEX, PageDirection)
Printer.EndDoc  '如无此句,printer.orinentation等值将不同时改变。
End Sub
Public Sub ChngOrientationPortrait()
If Printer.Orientation = 1 Then
Fangxiang = True
ElseIf Printer.Orientation = 2 Then
Fangxiang = False
End If
PageDirection = 1
Call SetOrientation(DMDUP_SIMPLEX, 1)
End Sub

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?