📄 frmsetpage.frm
字号:
VERSION 5.00
Object = "{86CF1D34-0C5F-11D2-A9FC-0000F8754DA1}#2.0#0"; "MSCOMCT2.OCX"
Begin VB.Form frmSetPage
Caption = "设置打印边界"
ClientHeight = 3090
ClientLeft = 60
ClientTop = 450
ClientWidth = 4680
LinkTopic = "Form1"
ScaleHeight = 3090
ScaleWidth = 4680
StartUpPosition = 3 '窗口缺省
Begin VB.TextBox txtXS
BeginProperty DataFormat
Type = 1
Format = "0"
HaveTrueFalseNull= 0
FirstDayOfWeek = 0
FirstWeekOfYear = 0
LCID = 2052
SubFormatType = 1
EndProperty
Height = 300
IMEMode = 3 'DISABLE
Index = 3
Left = 1080
MaxLength = 3
TabIndex = 10
Text = "10"
Top = 1320
Width = 615
End
Begin VB.TextBox txtXS
BeginProperty DataFormat
Type = 1
Format = "0"
HaveTrueFalseNull= 0
FirstDayOfWeek = 0
FirstWeekOfYear = 0
LCID = 2052
SubFormatType = 1
EndProperty
Height = 300
IMEMode = 3 'DISABLE
Index = 2
Left = 1080
MaxLength = 3
TabIndex = 9
Text = "0"
Top = 600
Width = 615
End
Begin VB.CommandButton cmdOK
Caption = "确定"
Default = -1 'True
Height = 360
Left = 1785
TabIndex = 8
Top = 2040
Width = 1215
End
Begin VB.CommandButton cmdCancel
Caption = "取消"
Height = 360
Left = 3120
TabIndex = 7
Top = 2040
Width = 1215
End
Begin VB.TextBox txtXS
BeginProperty DataFormat
Type = 1
Format = "0"
HaveTrueFalseNull= 0
FirstDayOfWeek = 0
FirstWeekOfYear = 0
LCID = 2052
SubFormatType = 1
EndProperty
Height = 300
IMEMode = 3 'DISABLE
Index = 1
Left = 1080
MaxLength = 3
TabIndex = 6
Text = "10"
Top = 960
Width = 615
End
Begin VB.TextBox txtXS
BeginProperty DataFormat
Type = 1
Format = "0"
HaveTrueFalseNull= 0
FirstDayOfWeek = 0
FirstWeekOfYear = 0
LCID = 2052
SubFormatType = 1
EndProperty
Height = 300
IMEMode = 3 'DISABLE
Index = 0
Left = 1080
MaxLength = 3
TabIndex = 5
Text = "20"
Top = 240
Width = 615
End
Begin VB.CommandButton cmdSetPrint
Caption = "打印设置"
Height = 360
Left = 2760
TabIndex = 0
Top = 360
Width = 1335
End
Begin MSComCtl2.UpDown UpDownXS
Height = 300
Index = 3
Left = 1680
TabIndex = 1
TabStop = 0 'False
Top = 1320
Width = 375
_ExtentX = 661
_ExtentY = 529
_Version = 393216
Value = 10
BuddyControl = "UpDownXS(3)"
BuddyDispid = 196610
BuddyIndex = 3
OrigLeft = 3960
OrigTop = 840
OrigRight = 4335
OrigBottom = 1140
Max = 100
Orientation = 1
SyncBuddy = -1 'True
BuddyProperty = 0
Enabled = -1 'True
End
Begin MSComCtl2.UpDown UpDownXS
Height = 300
Index = 2
Left = 1680
TabIndex = 2
TabStop = 0 'False
Top = 600
Width = 375
_ExtentX = 661
_ExtentY = 529
_Version = 393216
BuddyControl = "UpDownXS(2)"
BuddyDispid = 196610
BuddyIndex = 2
OrigLeft = 3960
OrigTop = 480
OrigRight = 4335
OrigBottom = 780
Max = 100
Orientation = 1
SyncBuddy = -1 'True
BuddyProperty = 0
Enabled = -1 'True
End
Begin MSComCtl2.UpDown UpDownXS
Height = 300
Index = 1
Left = 1680
TabIndex = 3
TabStop = 0 'False
Top = 960
Width = 375
_ExtentX = 661
_ExtentY = 529
_Version = 393216
Value = 10
BuddyControl = "UpDownXS(1)"
BuddyDispid = 196610
BuddyIndex = 1
OrigLeft = 1800
OrigTop = 840
OrigRight = 2175
OrigBottom = 1140
Max = 100
Orientation = 1
SyncBuddy = -1 'True
BuddyProperty = 0
Enabled = -1 'True
End
Begin MSComCtl2.UpDown UpDownXS
Height = 300
Index = 0
Left = 1680
TabIndex = 4
TabStop = 0 'False
Top = 240
Width = 375
_ExtentX = 661
_ExtentY = 529
_Version = 393216
Value = 20
BuddyControl = "UpDownXS(0)"
BuddyDispid = 196610
BuddyIndex = 0
OrigLeft = 1800
OrigTop = 480
OrigRight = 2175
OrigBottom = 780
Max = 100
Orientation = 1
SyncBuddy = -1 'True
BuddyProperty = 0
Enabled = -1 'True
End
Begin VB.Label lblFieldLabel
AutoSize = -1 'True
Caption = "右(毫米):"
Height = 180
Index = 5
Left = 240
TabIndex = 14
Top = 600
Width = 810
End
Begin VB.Label lblFieldLabel
AutoSize = -1 'True
Caption = "下(毫米):"
Height = 180
Index = 2
Left = 240
TabIndex = 13
Top = 1320
Width = 810
End
Begin VB.Label lblFieldLabel
AutoSize = -1 'True
Caption = "上(毫米):"
Height = 180
Index = 7
Left = 240
TabIndex = 12
Top = 960
Width = 810
End
Begin VB.Label lblFieldLabel
AutoSize = -1 'True
Caption = "左(毫米):"
Height = 180
Index = 6
Left = 240
TabIndex = 11
Top = 240
Width = 810
End
Begin VB.Line Line8
BorderColor = &H80000005&
X1 = 4440
X2 = 4440
Y1 = 0
Y2 = 1800
End
Begin VB.Line Line7
BorderColor = &H80000003&
X1 = 0
X2 = 0
Y1 = 0
Y2 = 1800
End
Begin VB.Line Line6
BorderColor = &H80000005&
X1 = 0
X2 = 4460
Y1 = 1800
Y2 = 1800
End
Begin VB.Line Line5
BorderColor = &H80000003&
X1 = 0
X2 = 4440
Y1 = 0
Y2 = 0
End
End
Attribute VB_Name = "frmSetPage"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Public intTop As Integer
Public intLeft As Integer
Public intRight As Integer
Public intBottom As Integer
Public bOK As Byte
Private Sub cmdCancel_Click()
bOK = 0
txtXS(0).SetFocus
Hide
End Sub
Private Sub cmdOK_Click()
intTop = txtXS(1) * 60
intLeft = txtXS(0) * 60
intRight = txtXS(2) * 60
intBottom = txtXS(3) * 60
bOK = 1
txtXS(0).SetFocus
Hide
End Sub
Private Sub cmdSetPrint_Click()
fMain.SetPrint
End Sub
Private Sub Form_Activate()
bOK = 0
End Sub
Private Sub txtXS_Change(Index As Integer)
If Val(txtXS(Index)) < 0 Then
txtXS(Index) = 0
End If
If Val(txtXS(Index)) > 100 Then
txtXS(Index) = 100
End If
txtXS(Index) = Val(txtXS(Index))
End Sub
Private Sub txtXS_GotFocus(Index As Integer)
txtXS(Index).SelStart = 0
txtXS(Index).SelLength = Len(txtXS(Index))
End Sub
Private Sub txtXS_KeyDown(Index As Integer, KeyCode As Integer, Shift As Integer)
If KeyCode = vbKeyDown Then
If Val(txtXS(Index)) <= 0 Then
txtXS(Index) = 100
Exit Sub
End If
txtXS(Index) = Val(txtXS(Index)) - 1
ElseIf KeyCode = vbKeyUp Then
If Val(txtXS(Index)) >= 100 Then
txtXS(Index) = 0
Exit Sub
End If
txtXS(Index) = Val(txtXS(Index)) + 1
End If
End Sub
Private Sub UpDownXS_Change(Index As Integer)
txtXS(Index).SetFocus
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -