📄 prnprn1.frm
字号:
VERSION 5.00
Begin VB.Form PrnPRN1
Caption = "Form11"
ClientHeight = 4695
ClientLeft = 60
ClientTop = 450
ClientWidth = 6510
LinkTopic = "Form11"
ScaleHeight = 4695
ScaleWidth = 6510
StartUpPosition = 3 '窗口缺省
Begin VB.PictureBox Apre
BackColor = &H000000FF&
Height = 1000
Left = 0
ScaleHeight = 945
ScaleWidth = 945
TabIndex = 8
Top = 0
Width = 1000
End
Begin VB.TextBox tPag
Height = 300
Left = 3312
TabIndex = 7
Text = "1"
Top = 0
Width = 768
End
Begin VB.CommandButton Command1
Caption = "&Print"
Height = 300
Left = 900
TabIndex = 6
ToolTipText = "print"
Top = 1440
Width = 1020
End
Begin VB.CommandButton Command2
Caption = "A&bort"
Height = 300
Left = 1980
TabIndex = 5
ToolTipText = "exit"
Top = 1476
Width = 1020
End
Begin VB.CommandButton Command3
Caption = "Pri&nter"
Height = 300
Left = 3060
TabIndex = 4
ToolTipText = "select printer"
Top = 1476
Width = 1020
End
Begin VB.ComboBox sPag
Height = 300
ItemData = "PrnPRN1.frx":0000
Left = 3312
List = "PrnPRN1.frx":0007
Style = 2 'Dropdown List
TabIndex = 3
Top = 720
Width = 768
End
Begin VB.ComboBox ePag
Height = 300
ItemData = "PrnPRN1.frx":000E
Left = 3312
List = "PrnPRN1.frx":0015
Style = 2 'Dropdown List
TabIndex = 2
Top = 1080
Width = 768
End
Begin VB.PictureBox Picture1
Appearance = 0 'Flat
AutoRedraw = -1 'True
AutoSize = -1 'True
BorderStyle = 0 'None
ForeColor = &H80000008&
Height = 480
Left = 72
Picture = "PrnPRN1.frx":001C
ScaleHeight = 480
ScaleWidth = 480
TabIndex = 1
Top = 36
Width = 480
End
Begin VB.CommandButton Command4
Caption = "Select only active page"
Height = 288
Left = 900
TabIndex = 0
ToolTipText = "select activee (viewed) page"
Top = 432
Width = 3180
End
Begin VB.Label Label1
Alignment = 1 'Right Justify
Caption = "Total preview pages:"
Height = 228
Left = 900
TabIndex = 11
Top = 36
Width = 2352
End
Begin VB.Label Label2
Alignment = 1 'Right Justify
Caption = "print from page:"
Height = 228
Left = 900
TabIndex = 10
Top = 792
Width = 2352
End
Begin VB.Label Label3
Alignment = 1 'Right Justify
Caption = "to page:"
Height = 228
Left = 900
TabIndex = 9
Top = 1116
Width = 2352
End
Begin VB.Line Line1
X1 = 864
X2 = 4068
Y1 = 360
Y2 = 360
End
Begin VB.Line Line2
X1 = 864
X2 = 4068
Y1 = 1404
Y2 = 1404
End
Begin VB.Shape tBar
BackColor = &H8000000F&
BackStyle = 1 'Opaque
Height = 192
Left = 0
Top = 1836
Width = 4116
End
Begin VB.Shape pBar
BackColor = &H8000000D&
BackStyle = 1 'Opaque
Height = 192
Left = 0
Top = 1836
Width = 12
End
End
Attribute VB_Name = "PrnPRN1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Private Sub Command1_Click()
Static sP As Integer, eP As Integer, Ret As Integer
sP = Val(sPag.Text)
eP = Val(ePag.Text)
If sP > eP Then
eP = sP
Ret = MsgBox("Page " + Format(sP) + "?", _
vbYesNo + vbQuestion, _
"Print")
Else
Ret = MsgBox("From page " + vbTab + Format(sP) + vbLf + _
"to page " + vbTab + Format(eP) + "?", _
vbYesNo + vbQuestion, _
"Print")
End If
If Ret = vbYes Then
NM_AnnullaStampa = False
TempStampa sP, eP
End If
End Sub
Private Sub Command2_Click()
NM_AnnullaStampa = True
Unload Me
End Sub
Private Sub Command3_Click()
Apre.Flags = cdlPDPrintSetup
Apre.Action = &H5
End Sub
Private Sub Command4_Click()
sPag.ListIndex = PrnPRV.ePag.ListIndex
ePag.ListIndex = PrnPRV.ePag.ListIndex
End Sub
Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = 27 Then Unload Me
End Sub
Private Sub Form_Load()
tPag.Text = Format(PrnPRV.ePag.ListCount)
Static l As Integer
For l = 0 To PrnPRV.ePag.ListCount - 1
sPag.AddItem Format(l + 1)
ePag.AddItem Format(l + 1)
Next
sPag.ListIndex = 0
ePag.ListIndex = ePag.ListCount - 1
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -