📄 frmpagesetup.frm
字号:
Top = 1680
Width = 855
End
Begin VB.TextBox txtHeaderMargin
Height = 270
Left = 3480
Locked = -1 'True
MultiLine = -1 'True
ScrollBars = 2 'Vertical
TabIndex = 29
Top = 240
Width = 855
End
Begin VB.TextBox txtBottomMargin
Height = 270
Left = 1800
Locked = -1 'True
MultiLine = -1 'True
ScrollBars = 2 'Vertical
TabIndex = 23
Top = 3120
Width = 855
End
Begin VB.TextBox txtTopMargin
Height = 270
Left = 1800
Locked = -1 'True
MultiLine = -1 'True
ScrollBars = 2 'Vertical
TabIndex = 21
Top = 240
Width = 855
End
Begin VB.TextBox txtFooterMargin
Height = 270
Left = 3480
Locked = -1 'True
MultiLine = -1 'True
ScrollBars = 2 'Vertical
TabIndex = 31
Top = 3120
Width = 855
End
Begin VB.CheckBox chkCenterHorizontally
Caption = "水平居中(&Z)"
Height = 255
Left = 840
TabIndex = 32
Top = 3840
Width = 1335
End
Begin VB.CheckBox chkCenterVertically
Caption = "垂直居中(&V)"
Height = 255
Left = 2520
TabIndex = 33
Top = 3840
Width = 1455
End
Begin VB.Line lineHeader
BorderColor = &H00C0C0C0&
X1 = 1500
X2 = 2915
Y1 = 840
Y2 = 840
End
Begin VB.Line lineLeft
BorderColor = &H00C0C0C0&
X1 = 1635
X2 = 1635
Y1 = 735
Y2 = 2640
End
Begin VB.Label Label10
AutoSize = -1 'True
Caption = "上(&T):"
Height = 180
Left = 1800
TabIndex = 20
Top = 0
Width = 540
End
Begin VB.Label Label11
AutoSize = -1 'True
Caption = "下(&B):"
Height = 180
Left = 1800
TabIndex = 22
Top = 2880
Width = 540
End
Begin VB.Label Label12
AutoSize = -1 'True
Caption = "左(&L):"
Height = 180
Left = 120
TabIndex = 24
Top = 1440
Width = 540
End
Begin VB.Label Label13
AutoSize = -1 'True
Caption = "右(&R):"
Height = 180
Left = 3480
TabIndex = 26
Top = 1440
Width = 540
End
Begin VB.Label Label14
AutoSize = -1 'True
Caption = "页眉(&H):"
Height = 180
Left = 3480
TabIndex = 28
Top = 0
Width = 720
End
Begin VB.Label Label15
AutoSize = -1 'True
Caption = "页脚(&F):"
Height = 180
Left = 3480
TabIndex = 30
Top = 2880
Width = 720
End
Begin VB.Label Label16
AutoSize = -1 'True
Caption = "居中方式"
Height = 180
Left = 0
TabIndex = 51
Top = 3615
Width = 720
End
Begin VB.Line Line8
BorderColor = &H00808080&
X1 = 840
X2 = 6010
Y1 = 3720
Y2 = 3720
End
Begin VB.Line lineTop
BorderColor = &H00C0C0C0&
X1 = 1500
X2 = 2915
Y1 = 960
Y2 = 960
End
Begin VB.Line lineBottom
BorderColor = &H00C0C0C0&
X1 = 1500
X2 = 2915
Y1 = 2400
Y2 = 2400
End
Begin VB.Line lineFooter
BorderColor = &H00C0C0C0&
X1 = 1500
X2 = 2915
Y1 = 2520
Y2 = 2520
End
Begin VB.Line lineRight
BorderColor = &H00C0C0C0&
X1 = 2760
X2 = 2760
Y1 = 735
Y2 = 2640
End
Begin VB.Line Line7
BorderColor = &H00FFFFFF&
BorderWidth = 2
X1 = 840
X2 = 6010
Y1 = 3735
Y2 = 3720
End
Begin VB.Image imgGrid
Height = 930
Left = 1635
Top = 960
Width = 960
End
Begin VB.Label Label9
Appearance = 0 'Flat
BackColor = &H80000005&
BorderStyle = 1 'Fixed Single
ForeColor = &H80000008&
Height = 1935
Left = 1485
TabIndex = 52
Top = 720
Width = 1440
End
End
Begin VB.PictureBox fraHeaderFooter
BorderStyle = 0 'None
Height = 4215
Left = 240
ScaleHeight = 4215
ScaleWidth = 6255
TabIndex = 53
TabStop = 0 'False
Top = 600
Visible = 0 'False
Width = 6255
Begin VB.ComboBox cboHeaderAlign
Height = 300
Left = 0
Style = 2 'Dropdown List
TabIndex = 36
Top = 1560
Width = 1575
End
Begin VB.CommandButton cmdSetFont
Caption = "设置字体"
Height = 300
Index = 0
Left = 1800
TabIndex = 37
Top = 1560
Width = 1095
End
Begin VB.TextBox txtHeader
Appearance = 0 'Flat
Height = 1150
Left = 0
TabIndex = 35
Top = 240
Width = 6135
End
Begin VB.TextBox txtFooter
Appearance = 0 'Flat
Height = 1150
Left = 0
TabIndex = 39
Top = 2400
Width = 6135
End
Begin VB.ComboBox cboFooterAlign
Height = 300
Left = 0
Style = 2 'Dropdown List
TabIndex = 40
Top = 3720
Width = 1575
End
Begin VB.CommandButton cmdSetFont
Caption = "设置字体"
Height = 300
Index = 1
Left = 1800
TabIndex = 41
Top = 3720
Width = 1095
End
Begin VB.Label Label1
BackColor = &H00000000&
Height = 1150
Left = 30
TabIndex = 55
Top = 270
Width = 6135
End
Begin VB.Label Label2
BackColor = &H00000000&
Height = 1150
Left = 30
TabIndex = 54
Top = 2430
Width = 6135
End
Begin VB.Label Label3
AutoSize = -1 'True
Caption = "页眉(&H):"
Height = 180
Left = 0
TabIndex = 34
Top = 0
Width = 720
End
Begin VB.Label Label4
AutoSize = -1 'True
Caption = "页脚(&F):"
Height = 180
Left = 0
TabIndex = 38
Top = 2160
Width = 720
End
End
Begin MSComctlLib.TabStrip TabStrip1
Height = 4935
Left = 120
TabIndex = 44
Top = 120
Width = 6450
_ExtentX = 11377
_ExtentY = 8705
_Version = 393216
BeginProperty Tabs {1EFB6598-857C-11D1-B16A-00C0F0283628}
NumTabs = 3
BeginProperty Tab1 {1EFB659A-857C-11D1-B16A-00C0F0283628}
Caption = " 页面 "
ImageVarType = 2
EndProperty
BeginProperty Tab2 {1EFB659A-857C-11D1-B16A-00C0F0283628}
Caption = " 页边距 "
ImageVarType = 2
EndProperty
BeginProperty Tab3 {1EFB659A-857C-11D1-B16A-00C0F0283628}
Caption = "页眉/页脚"
ImageVarType = 2
EndProperty
EndProperty
End
End
Attribute VB_Name = "frmPageSetup"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Private Declare Function GetScrollPos Lib "user32" (ByVal hWnd As Long, ByVal nBar As Long) As Long
Private Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hWnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As Any) As Long
Private Const WM_VSCROLL = &H115
Private Const SB_THUMBPOSITION = 4
Private Const SB_BOTTOM = 7
Private Const SB_VERT = 1
Private Const SB_TOP = 6
Private mGrid As FlexCell.Grid
Private Sub cboFooterAlign_Click()
Select Case cboFooterAlign.ListIndex
Case 0
txtFooter.Alignment = 0
Case 1
txtFooter.Alignment = 2
Case 2
txtFooter.Alignment = 1
End Select
End Sub
Private Sub cboHeaderAlign_Click()
Select Case cboHeaderAlign.ListIndex
Case 0
txtHeader.Alignment = 0
Case 1
txtHeader.Alignment = 2
Case 2
txtHeader.Alignment = 1
End Select
End Sub
Private Sub cboPaperSize_Click()
If cboPaperSize.ListIndex = cboPaperSize.ListCount - 1 Then
txtPaperWidth.Text = mGrid.PageSetup.PaperWidth
txtPaperHeight.Text = mGrid.PageSetup.PaperHeight
Label20.Visible = True
Label21.Visible = True
txtPaperWidth.Visible = True
txtPaperHeight.Visible = True
Else
Label20.Visible = False
Label21.Visible = False
txtPaperWidth.Visible = False
txtPaperHeight.Visible = False
End If
End Sub
Private Sub chkCenterHorizontally_Click()
If chkCenterHorizontally.Value = vbChecked Then
imgGrid.Left = lineLeft.X1 + (lineRight.X1 - lineLeft.X1 - imgGrid.Width) / 2
Else
imgGrid.Left = lineLeft.X1
End If
End Sub
Private Sub chkCenterVertically_Click()
If chkCenterVertically.Value = vbChecked Then
imgGrid.Top = lineTop.Y1 + (lineBottom.Y1 - lineTop.Y1 - imgGrid.Height) / 2
Else
imgGrid.Top = lineTop.Y1
End If
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -