📄 frmsetpaper.frm
字号:
VERSION 5.00
Object = "{D252F124-F62C-11D1-9ABD-444553540000}#1.0#0"; "GADATE.DLL"
Begin VB.Form FrmSetPaper
BorderStyle = 1 'Fixed Single
Caption = "设置纸张"
ClientHeight = 2820
ClientLeft = 3780
ClientTop = 4050
ClientWidth = 5760
HelpContextID = 10006
Icon = "FrmSetPaper.frx":0000
LinkTopic = "Form2"
LockControls = -1 'True
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 2820
ScaleWidth = 5760
StartUpPosition = 2 '屏幕中心
Begin VB.CommandButton CmdCancel
Height = 350
Left = 4410
Style = 1 'Graphical
TabIndex = 9
Top = 720
UseMaskColor = -1 'True
Width = 1215
End
Begin VB.CommandButton CmdOK
Height = 350
Left = 4410
Style = 1 'Graphical
TabIndex = 8
Top = 180
UseMaskColor = -1 'True
Width = 1215
End
Begin VB.Frame Frame2
Caption = "方向"
Height = 795
Left = 180
TabIndex = 1
Top = 1920
Width = 4095
Begin VB.OptionButton OptLandscape
Caption = "横向"
Height = 285
Left = 2760
TabIndex = 7
Top = 360
Width = 660
End
Begin VB.OptionButton OptPortrait
Caption = "纵向"
Height = 285
Left = 1740
TabIndex = 6
Top = 360
Width = 780
End
Begin VB.PictureBox PicLandscape
Appearance = 0 'Flat
AutoSize = -1 'True
BorderStyle = 0 'None
ForeColor = &H80000008&
Height = 480
Left = 420
Picture = "FrmSetPaper.frx":0442
ScaleHeight = 480
ScaleWidth = 480
TabIndex = 5
Top = 240
Visible = 0 'False
Width = 480
End
Begin VB.PictureBox PicPortrait
Appearance = 0 'Flat
AutoSize = -1 'True
BorderStyle = 0 'None
ForeColor = &H80000008&
Height = 480
Left = 420
Picture = "FrmSetPaper.frx":0B84
ScaleHeight = 480
ScaleWidth = 480
TabIndex = 4
Top = 240
Visible = 0 'False
Width = 480
End
End
Begin VB.Frame Frame1
Caption = "纸张"
Height = 1695
Left = 180
TabIndex = 0
Top = 120
Width = 4095
Begin VB.Frame Frame3
Caption = "单位"
Height = 825
Left = 2280
TabIndex = 16
Top = 660
Width = 1695
Begin VB.OptionButton OptInch
Caption = "0.01英寸"
Height = 195
Left = 240
TabIndex = 18
Top = 510
Width = 1035
End
Begin VB.OptionButton OptMM
Caption = "0.1毫米"
Height = 195
Left = 240
TabIndex = 17
Top = 240
Width = 1005
End
End
Begin GACALENDARLibCtl.SpinEdit SpiHeight
Height = 315
Left = 930
OleObjectBlob = "FrmSetPaper.frx":12C6
TabIndex = 15
Top = 1170
Width = 1155
End
Begin GACALENDARLibCtl.SpinEdit SpiWidth
Height = 315
Left = 930
OleObjectBlob = "FrmSetPaper.frx":136D
TabIndex = 14
Top = 750
Width = 1155
End
Begin VB.ComboBox CboSize
Height = 300
Left = 930
Style = 2 'Dropdown List
TabIndex = 3
Top = 300
Width = 3060
End
Begin VB.Label lblUnit2
Caption = "毫米"
Height = 165
Left = 1890
TabIndex = 13
Top = -345
Visible = 0 'False
Width = 15
End
Begin VB.Label lblUnit1
Caption = "毫米"
Height = 225
Left = 1890
TabIndex = 12
Top = -750
Visible = 0 'False
Width = 15
End
Begin VB.Label Label15
Caption = "宽度(&W)"
Height = 195
Left = 180
TabIndex = 11
Top = 795
Width = 735
End
Begin VB.Label Label14
Caption = "高度(&H)"
Height = 255
Left = 180
TabIndex = 10
Top = 1215
Width = 735
End
Begin VB.Label Label1
Caption = "大小(Z)"
Height = 225
Left = 180
TabIndex = 2
Top = 360
Width = 645
End
End
End
Attribute VB_Name = "FrmSetPaper"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
'''''''''''''''''''''''''''''''''''''''''''''''''''
'纸张设置窗口
'Author: Lipeng 1998.7
'
'''''''''''''''''''''''''''''''''''''''''''''
Option Explicit
Private mArrayPapersize(1 To 56) As String
Private strX(0 To 56) As String
Private strY(0 To 56) As String
Private mclsFset As ClsFormatset
Private mblnOk As Boolean
Private mblnChange As Boolean
Private mblnLoaded As Boolean
Private mblnSize As Boolean '是否响应事件
Private mlngWidth As Long '纸张宽度
Private mlngHeight As Long '纸张高度
Private mstrOld As String
Private mlngHeaderHeight As Long
Private mblnIsChange As Boolean
'公共接口
Public Function ShowFrmSetPaper(clsFset As ClsFormatset, Optional ByVal lngHeaderHeight As Long = 0) As Boolean
Set mclsFset = clsFset
mlngHeaderHeight = lngHeaderHeight
Me.Show vbModal
ShowFrmSetPaper = mblnOk
End Function
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
' 控件过程
'
Private Sub CboSize_Click()
If Not mblnLoaded Then Exit Sub
mblnSize = False
OptMM.Value = True
PaperSize CboSize.ItemData(CboSize.ListIndex)
mblnChange = True
mblnSize = True
End Sub
Private Sub CmdCancel_Click()
mblnOk = False
Unload Me
End Sub
Private Sub cmdOK_Click()
mblnOk = True
ResetPaper '改变类的属性
Unload Me
End Sub
Private Sub Form_Activate()
SetHelpID C2lng(Me.HelpContextID)
End Sub
Private Sub Form_Load()
On Error GoTo ErrHandle
mblnLoaded = False
InitArray '初始化数组
LoadResMap
AddItemPaper
InitForm
mblnLoaded = True
mblnChange = False
ErrHandle:
End Sub
Private Sub Form_Unload(Cancel As Integer)
Utility.RemoveFormResPicture 139
Utility.RemoveFormResPicture 1001
Utility.RemoveFormResPicture 1002
Set mclsFset = Nothing
Erase mArrayPapersize
Erase strX
Erase strY
End Sub
Private Sub OptInch_Click()
If Not mblnLoaded Then Exit Sub
mblnSize = False
SpiWidth.Text = MMToInch(Val(SpiWidth.Text))
SpiHeight.Text = MMToInch(Val(SpiHeight.Text))
SpiWidth.Min = MMToInch(SpiWidth.Min)
SpiWidth.Max = MMToInch(SpiWidth.Max)
mblnChange = True
mblnSize = True
End Sub
Private Sub OptMM_Click()
If Not mblnLoaded Then Exit Sub
mblnSize = False
SpiWidth.Text = InchToMM(Val(SpiWidth.Text))
SpiHeight.Text = InchToMM(Val(SpiHeight.Text))
SpiWidth.Min = InchToMM(SpiWidth.Min)
SpiWidth.Max = InchToMM(SpiWidth.Max)
mblnChange = True
mblnSize = True
End Sub
Private Sub OptLandscape_Click()
If Not mblnLoaded Then Exit Sub
PicLandscape.Visible = True
PicPortrait.Visible = False
Exchange
mblnChange = True
End Sub
Private Sub OptPortrait_Click()
If Not mblnLoaded Then Exit Sub
PicLandscape.Visible = False
PicPortrait.Visible = True
Exchange
mblnChange = True
End Sub
Private Sub SpiHeight_Change()
If Not (mblnLoaded And mblnSize) Then Exit Sub
If Not IsNumeric(SpiHeight.Text) Then
Utility.ShowMsg Me.hWnd, "请输入数值!", vbOKOnly + vbInformation, "纸张设置"
SpiHeight.Text = mstrOld
ElseIf Val(SpiHeight.Text) < SpiHeight.Min Or Val(SpiHeight.Text) > SpiHeight.Max Then
Utility.ShowMsg Me.hWnd, " 无效数值! 有效范围[" & SpiHeight.Min & "—" & SpiHeight.Max & "]", vbOKOnly + vbInformation, "纸张设置"
SpiHeight.Text = mstrOld
Else
End If
mblnChange = True
End Sub
Private Sub SpiHeight_GotFocus()
mstrOld = SpiHeight.Text
End Sub
Private Sub SpiWidth_Change()
If Not (mblnLoaded And mblnSize) Then Exit Sub
If Not IsNumeric(SpiWidth.Text) Then
Utility.ShowMsg Me.hWnd, "请输入数值!", vbOKOnly + vbInformation, "纸张设置"
SpiWidth.Text = mstrOld
ElseIf Val(SpiWidth.Text) < SpiWidth.Min Or Val(SpiWidth.Text) > SpiWidth.Max Then
Utility.ShowMsg Me.hWnd, "无效数值! 有效范围[" & SpiWidth.Min & "—" & SpiWidth.Max & "]", vbOKOnly + vbInformation, "纸张设置"
SpiWidth.Text = mstrOld
Else
End If
mblnChange = True
End Sub
Private Sub SpiWidth_GotFocus()
mstrOld = SpiWidth.Text
End Sub
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -