📄 frmdefinefhself.frm
字号:
VERSION 5.00
Begin VB.Form FrmFHDeFineSelf
BorderStyle = 1 'Fixed Single
ClientHeight = 3195
ClientLeft = 45
ClientTop = 330
ClientWidth = 6300
HelpContextID = 10218
Icon = "FrmDeFineFHSelf.frx":0000
LinkTopic = "Form1"
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 3195
ScaleWidth = 6300
StartUpPosition = 2 '屏幕中心
Begin VB.CommandButton cmdPageHFSetup
Height = 360
Index = 5
Left = 3435
Style = 1 'Graphical
TabIndex = 17
Tag = "user"
ToolTipText = "制表"
Top = 120
UseMaskColor = -1 'True
Width = 650
End
Begin VB.CommandButton cmdPageHFSetup
Height = 360
Index = 4
Left = 2760
Style = 1 'Graphical
TabIndex = 16
Tag = "accoutbase"
ToolTipText = "单位名称"
Top = 120
UseMaskColor = -1 'True
Width = 650
End
Begin VB.CommandButton cmdPageHFSetup
Height = 360
Index = 3
Left = 2070
Style = 1 'Graphical
TabIndex = 15
Tag = "time"
ToolTipText = "时间"
Top = 120
UseMaskColor = -1 'True
Width = 650
End
Begin VB.CommandButton cmdPageHFSetup
Height = 360
Index = 2
Left = 1395
Style = 1 'Graphical
TabIndex = 14
Tag = "date"
ToolTipText = "日期"
Top = 120
UseMaskColor = -1 'True
Width = 650
End
Begin VB.CommandButton cmdPageHFSetup
Height = 360
Index = 1
Left = 720
Style = 1 'Graphical
TabIndex = 13
Tag = "pagecount"
ToolTipText = "总页数"
Top = 120
UseMaskColor = -1 'True
Width = 650
End
Begin VB.CommandButton cmdPageHFSetup
Height = 360
Index = 0
Left = 0
Style = 1 'Graphical
TabIndex = 12
Tag = "pageNo"
ToolTipText = "页码"
Top = 120
UseMaskColor = -1 'True
Width = 650
End
Begin VB.CommandButton cmdPageHFSetup
Height = 360
Index = 6
Left = 4110
Style = 1 'Graphical
TabIndex = 11
Tag = "user"
ToolTipText = "主管"
Top = 120
UseMaskColor = -1 'True
Visible = 0 'False
Width = 650
End
Begin VB.CommandButton cmdPageHFSetup
Height = 360
Index = 7
Left = 4800
Style = 1 'Graphical
TabIndex = 10
Tag = "user"
ToolTipText = "复核"
Top = 120
UseMaskColor = -1 'True
Visible = 0 'False
Width = 650
End
Begin VB.CommandButton cmdPageHFSetup
Height = 360
Index = 8
Left = 5490
Style = 1 'Graphical
TabIndex = 9
Tag = "user"
ToolTipText = "批准"
Top = 120
UseMaskColor = -1 'True
Visible = 0 'False
Width = 650
End
Begin VB.CommandButton cmdPageHFSetup
Height = 360
Index = 9
Left = 6180
Style = 1 'Graphical
TabIndex = 8
Tag = "user"
ToolTipText = "经手人"
Top = 120
UseMaskColor = -1 'True
Visible = 0 'False
Width = 650
End
Begin VB.TextBox txtPage
Height = 1596
Index = 0
Left = 30
MultiLine = -1 'True
ScrollBars = 2 'Vertical
TabIndex = 4
Tag = "left"
Top = 930
Width = 1524
End
Begin VB.TextBox txtPage
Alignment = 2 'Center
Height = 1596
Index = 1
Left = 1605
MultiLine = -1 'True
ScrollBars = 2 'Vertical
TabIndex = 3
Tag = "center"
Top = 930
Width = 1500
End
Begin VB.TextBox txtPage
Alignment = 1 'Right Justify
Height = 1596
Index = 2
Left = 3135
MultiLine = -1 'True
ScrollBars = 2 'Vertical
TabIndex = 2
Tag = "right"
Top = 930
Width = 1500
End
Begin VB.CommandButton CmdOk
Height = 350
Left = 1770
Style = 1 'Graphical
TabIndex = 1
Top = 2790
UseMaskColor = -1 'True
Width = 1215
End
Begin VB.CommandButton CmdCancal
Height = 350
Left = 3390
Style = 1 'Graphical
TabIndex = 0
Top = 2790
UseMaskColor = -1 'True
Width = 1215
End
Begin VB.Label Label1
Caption = "右(&R)"
Height = 270
Index = 2
Left = 3180
TabIndex = 7
Top = 660
Width = 465
End
Begin VB.Label Label1
Caption = "中(&C)"
Height = 270
Index = 1
Left = 1620
TabIndex = 6
Top = 660
Width = 465
End
Begin VB.Label Label1
Caption = "左(&L)"
Height = 270
Index = 0
Left = 30
TabIndex = 5
Top = 630
Width = 465
End
End
Attribute VB_Name = "FrmFHDeFineSelf"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
'功能:页眉页脚自定义窗体
'作者:李鹏
'日期:1998年8月
'ShowFrmFHDefineSelf 显示窗体的接口
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
Option Explicit
Private mblnGotFocus As Boolean
Private mintIndex As Integer
Private mstrPageHFSetup(0 To 9) As String
Private mvarTxtPage(0 To 2) As Variant
Private mblnHeader As Boolean '页眉
Private mblnOk As Boolean
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
' 公共方法
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
Public Function ShowFrmFHDefineSelf(Optional ByVal blnHeader As Boolean = True) As Boolean
mblnHeader = blnHeader
Me.Show vbModal
ShowFrmFHDefineSelf = mblnOk
End Function
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
' 公共属性
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
Public Property Get g_TxtPage(ByVal i As Integer) As Variant
g_TxtPage = mvarTxtPage(i)
End Property
Public Property Let g_TxtPage(ByVal i As Integer, ByVal vData As Variant)
mvarTxtPage(i) = vData
End Property
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
' 控件过程
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
Private Sub CmdCancal_Click()
mblnOk = False
Unload Me
End Sub
Private Sub cmdOK_Click()
Dim intCount As Integer
mblnOk = True
For intCount = 0 To 2
mvarTxtPage(intCount) = txtPage(intCount)
Next intCount
ChangeFHValue
Unload Me
End Sub
Private Sub cmdPageHFSetup_Click(Index As Integer)
If mblnGotFocus Then
txtPage(mintIndex).Text = txtPage(mintIndex).Text & mstrPageHFSetup(Index)
End If
End Sub
Private Sub Form_Activate()
SetHelpID C2lng(Me.HelpContextID)
End Sub
Private Sub Form_Load()
Dim intCount As Integer
Me.HelpContextID = 10218
Me.Icon = Utility.GetFormResPicture(139, vbResIcon)
loadResPic
ReDefineForm
If mblnHeader Then '页眉
Me.Caption = "页眉自定义"
Else '页脚
Me.Caption = "页脚自定义"
End If
For intCount = 0 To 2
txtPage(intCount).Text = mvarTxtPage(intCount)
Next intCount
mstrPageHFSetup(0) = "第&[页码]页"
mstrPageHFSetup(1) = "/共&[总页数]页"
mstrPageHFSetup(2) = "打印日期&[日期]"
mstrPageHFSetup(3) = "打印时间&[时间]"
mstrPageHFSetup(4) = "单位&[单位名]"
mstrPageHFSetup(5) = "制表&[用户名]"
mstrPageHFSetup(6) = "主管&[主管]"
mstrPageHFSetup(7) = "复核&[复核]"
mstrPageHFSetup(8) = "批准&[批准]"
mstrPageHFSetup(9) = "经手人&[经手人]"
End Sub
Private Sub Form_Unload(Cancel As Integer)
ReleaseMap '释放位图资源
End Sub
Private Sub txtPage_LostFocus(Index As Integer)
mblnGotFocus = True
mintIndex = Index
End Sub
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
' 私有过程
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
'改变页眉页脚
Private Sub ChangeFHValue()
Dim intCount As Integer
For intCount = 0 To 2
mvarTxtPage(intCount) = txtPage(intCount)
Next intCount
End Sub
'加载资源
Private Sub loadResPic()
cmdPageHFSetup(0).Picture = GetFormResPicture(130, vbResBitmap)
cmdPageHFSetup(1).Picture = GetFormResPicture(131, vbResBitmap)
cmdPageHFSetup(2).Picture = GetFormResPicture(132, vbResBitmap)
cmdPageHFSetup(3).Picture = GetFormResPicture(133, vbResBitmap)
cmdPageHFSetup(4).Picture = GetFormResPicture(134, vbResBitmap)
cmdPageHFSetup(5).Picture = GetFormResPicture(135, vbResBitmap)
cmdPageHFSetup(6).Picture = GetFormResPicture(135, vbResBitmap)
cmdPageHFSetup(7).Picture = GetFormResPicture(135, vbResBitmap)
cmdPageHFSetup(8).Picture = GetFormResPicture(135, vbResBitmap)
cmdPageHFSetup(9).Picture = GetFormResPicture(135, vbResBitmap)
CmdOk.Picture = GetFormResPicture(1001, vbResBitmap)
CmdCancal.Picture = GetFormResPicture(1002, vbResBitmap)
End Sub
'释放资源
Private Sub ReleaseMap()
Dim intCount As Integer
For intCount = 0 To 5
Set cmdPageHFSetup(intCount).Picture = Nothing
Next intCount
Set CmdOk.Picture = Nothing
Set CmdCancal.Picture = Nothing
Utility.RemoveFormResPicture 130
Utility.RemoveFormResPicture 131
Utility.RemoveFormResPicture 132
Utility.RemoveFormResPicture 133
Utility.RemoveFormResPicture 134
Utility.RemoveFormResPicture 135
Utility.RemoveFormResPicture 1001
Utility.RemoveFormResPicture 1002
Utility.RemoveFormResPicture 139
End Sub
'根据版本,定义窗体
Private Sub ReDefineForm()
#If conWan = 1 Then '万能版
cmdPageHFSetup(6).Visible = True
cmdPageHFSetup(7).Visible = True
cmdPageHFSetup(8).Visible = True
cmdPageHFSetup(9).Visible = True
Me.width = 6915
txtPage(0).width = 2200
txtPage(1).width = 2200
txtPage(1).Left = 2310
Label1(1).Left = 2310
txtPage(2).width = 2200
txtPage(2).Left = 4590
Label1(2).Left = 4590
CmdOk.Left = 3600
CmdCancal.Left = 5280
#Else
cmdPageHFSetup(1).Left = 810
cmdPageHFSetup(2).Left = 1605
cmdPageHFSetup(3).Left = 2400
cmdPageHFSetup(4).Left = 3210
cmdPageHFSetup(5).Left = 3975
#End If
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -