📄 frmcrossbook.frm
字号:
For intCol = msgTitle.FixedCols + 1 To msgTitle.Cols - 2
If sngTotal < Val(msgAccount.TextMatrix(intRow, intCol)) Then _
sngTotal = Val(msgAccount.TextMatrix(intRow, intCol))
Next intCol
msgAccount.TextMatrix(intRow, intCol) = sngTotal
Next intRow
End Select
End If
'列合计
If mclsCross.IsColSum And mclsCross.ColTotalMethod > 0 Then
msgAccount.AddItem ""
msgAccount.TextMatrix(msgAccount.Rows - 1, 0) = "合计"
Select Case mclsCross.ColTotalMethod
Case 1 '求和
For intCol = msgAccount.FixedCols To msgAccount.Cols - 1
sngTotal = 0
For intRow = 1 To msgAccount.Rows - 2
sngTotal = sngTotal + Val(msgAccount.TextMatrix(intRow, intCol))
Next intRow
msgAccount.TextMatrix(intRow, intCol) = sngTotal
Next intCol
Case 2 '平均
For intCol = msgAccount.FixedCols To msgAccount.Cols - 1
sngTotal = 0
For intRow = 1 To msgAccount.Rows - 2
sngTotal = sngTotal + Val(msgAccount.TextMatrix(intRow, intCol))
Next intRow
msgAccount.TextMatrix(intRow, intCol) = sngTotal / (intRow - 1)
Next intCol
Case 3 '最小值
For intCol = msgAccount.FixedCols To msgAccount.Cols - 1
sngTotal = Val(msgAccount.TextMatrix(intRow, 1))
For intRow = 2 To msgAccount.Rows - 2
If sngTotal > Val(msgAccount.TextMatrix(intRow, intCol)) Then _
sngTotal = Val(msgAccount.TextMatrix(intRow, intCol))
Next intRow
msgAccount.TextMatrix(intRow, intCol) = sngTotal
Next intCol
Case 4 '最大值
For intCol = msgAccount.FixedCols To msgAccount.Cols - 1
sngTotal = Val(msgAccount.TextMatrix(intRow, 1))
For intRow = 2 To msgAccount.Rows - 2
If sngTotal < Val(msgAccount.TextMatrix(intRow, intCol)) Then _
sngTotal = Val(msgAccount.TextMatrix(intRow, intCol))
Next intRow
msgAccount.TextMatrix(intRow, intCol) = sngTotal
Next intCol
End Select
'处理行列合计方式不一致时,最后一个单元的内容显示(始终为空)
If mclsCross.IsRowSum And mclsCross.RowTotalMethod > 0 And _
mclsCross.RowTotalMethod <> mclsCross.ColTotalMethod Then _
msgAccount.TextMatrix(msgAccount.Rows - 1, msgAccount.Cols - 1) = Space(100) & "行列合计方式不同"
End If
End Sub
'装载弹出菜单
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
'
'底层接口 Author: Hebing 1998.7
'
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
Private Sub Form_Unload(Cancel As Integer)
Dim intType As Integer
If mblnChanged Then
intType = Utility.ShowMsg(Me.hwnd, "报表已改变,是否保存?", vbYesNo + vbQuestion, App.title)
If intType = 6 Then
cmdSave_Click
End If
End If
gclsSys.MainControls.Remove Me
Set mclsCross = Nothing
Set mclsMainControl = Nothing
Set mclsFormCond = Nothing
Set ABook = Nothing
Set clsFset = Nothing
End Sub
Private Sub CmdPaper_Click()
Dim nWidth As Long
Dim nHeight As Long
Dim frm As FrmSetPaper
Set frm = New FrmSetPaper
nWidth = PicPaper.ScaleWidth / (56.7 * GetZoomRate(ZoomIndex))
nHeight = PicPaper.ScaleHeight / (56.7 * GetZoomRate(ZoomIndex))
frm.ShowFrmSetPaper nWidth, nHeight, mclsCross.ReportID
Set frm = Nothing
PaperWidth = nWidth * 56.7
PaperHeight = nHeight * 56.7
PicPaper.width = nWidth * 56.7 * GetZoomRate(ZoomIndex)
PicPaper.Height = nHeight * 56.7 * GetZoomRate(ZoomIndex)
CmdPaper.ToolTipText = "纸张大小:" & nWidth & "毫米×" & nHeight & "毫米"
mlngCurPage = 1
VSpage.Value = 0
DispartPage
SetData '设置数据
InitScrollbar
End Sub
Private Sub CmdSpliter_MouseDown(Button As Integer, Shift As Integer, X As Single, y As Single)
ReleaseCapture
SetCapture Me.hwnd
mbResizeing = True
End Sub
Private Sub CmdZoom_Click()
InitMenu
PopupMenu frmMain.mnuListEdit
endmenu
End Sub
Private Sub Command1_Click()
ABook.ZoomRate = 150
ABook.Refresh
End Sub
Private Sub Form_MouseMove(Button As Integer, Shift As Integer, X As Single, y As Single)
If mbResizeing And Button = 1 Then
If X < 0 Then X = 0
If X > ScaleWidth / 2 Then
LSpliter.Left = ScaleWidth / 2
Else
LSpliter.Left = X
End If
End If
End Sub
Private Sub Form_MouseUp(Button As Integer, Shift As Integer, X As Single, y As Single)
Dim tmp As Integer
If mbResizeing Then
mbResizeing = False
tmp = LSpliter.Left - Picpage.Left - VSpage.width
If tmp > 0 Then
Picpage.Visible = True
VSpage.Visible = True
HSpage.Visible = True
Picpage.width = tmp
VSpage.Left = LSpliter.Left - VSpage.width
HSpage.width = tmp
Else
Picpage.Visible = False
VSpage.Visible = False
HSpage.Visible = False
End If
vsPAcount.Left = LSpliter.Left + LSpliter.width
CmdSpliter.Left = LSpliter.Left + LSpliter.width
CmdCurPage.Left = CmdSpliter.Left + CmdSpliter.width
CmdZoom.Left = CmdCurPage.Left + CmdCurPage.width
CmdPaper.Left = CmdZoom.Left + CmdZoom.width
HScroll.Left = CmdPaper.Left + CmdPaper.width
Form_Resize
If lPage(0).width < Picpage.width Then
HSpage.Enabled = False
HSpage.Value = 0
Else
HSpage.Enabled = True
HSpage.Max = (lPage(0).width - Picpage.width) / Screen.TwipsPerPixelX
HSpage.SmallChange = 1
HSpage.LargeChange = 5
End If
End If
End Sub
Private Sub grdAcntBook_Scroll()
' ClearZero
End Sub
Private Sub HScroll_Change()
PicPaper.Left = -Screen.TwipsPerPixelX * HScroll.Value + 90
SetShapePos mlngCurPage
PicPaper.SetFocus
End Sub
Private Sub HSpage_Change()
Dim i As Integer
Dim nleft As Long
Dim npos As Integer
Dim npos1 As Integer
On Error Resume Next
nleft = HSpage.Value * Screen.TwipsPerPixelX
npos = (lPage(0).width - Lcaption(0).width) / 2
npos1 = lPage(0).Left - Shape1.Left
For i = 0 To mlngPages - 1
lPage(i).Left = -nleft
Lcaption(i).Left = lPage(i).Left + npos
Next
Shape1.Left = lPage(0).Left + npos1
End Sub
Private Sub Lcaption_Click(Index As Integer)
lPage_Click Index
End Sub
Private Sub lPage_Click(Index As Integer)
If mintCurContents <> Index + 1 + VSpage.Value Then
mlngCurPage = Index + 1 + VSpage.Value
SetData
End If
Picpage.SetFocus
End Sub
Private Sub LSpliter_MouseDown(Button As Integer, Shift As Integer, X As Single, y As Single)
If Button = 1 Then
ReleaseCapture
SetCapture Me.hwnd
mbResizeing = True
End If
End Sub
Private Sub mclsMainControl_ToolRefresh()
RefreshData
End Sub
Private Sub VScroll_Change()
PicPaper.top = -Screen.TwipsPerPixelY * VScroll.Value + 90
SetShapePos mlngCurPage
PicPaper.SetFocus
End Sub
Private Sub CmdCurPage_Click()
Dim frm As FrmCurrenPage
Set frm = New FrmCurrenPage
Dim i As Integer
Dim nHeight As Integer
nHeight = lPage(0).Height + Lcaption(0).Height + 90
i = Picpage.Height / nHeight
If i > 10 Then i = 10
mlngCurPage = frm.ShowFrmCurrenPage(mlngCurPage, mlngPages)
If mlngCurPage <= VSpage.Value Then
VSpage.Value = mlngCurPage - 1
SetPageContents VSpage.Value, mlngPages
ElseIf mlngCurPage > VSpage.Value + i Then
VSpage.Value = mlngCurPage - i
SetPageContents VSpage.Value, mlngPages
End If
Set frm = Nothing
SetData '设置数据
End Sub
Private Sub cmdFormatSet_Click()
Dim blnOK As Boolean
clsFset.GPaperBorder(6) = ABook.GutterLineWidth
clsFset.GetDefaultDateFromDB mclsCross.ReportID
blnOK = clsFset.ShowFrmFormatSet(1, mclsCross.ReportID, mlngCurPage, mlngPages)
If blnOK Then
GetDefaultSet clsFset
RefreshData
End If
cmdFormatSet.SetFocus
End Sub
Private Sub Form_Load()
Me.Hide
Me.Left = -30000
MsgForm.PleaseWait
mintCurContents = 1
CmdPaper.ToolTipText = "纸张大小:" & Int(PicPaper.width / 56.7) & "毫米×" & Int(PicPaper.Height / 56.7) & "毫米"
ZoomIndex = 3
PaperWidth = PicPaper.width
PaperHeight = PicPaper.Height
CmdZoom.ToolTipText = "当前放缩比:100%"
End Sub
Private Sub Form_Resize()
On Error Resume Next
Dim i As Integer
If Me.width < lngFormWidth Then Me.width = lngFormWidth
If Me.Height < lngFormHeight Then Me.Height = lngFormHeight
If (Me.Left + Me.width < 0 Or Me.Left > Screen.width) And mblnLoaded Then
Me.Left = 300
End If
vsPAcount.width = ScaleWidth - VScroll.width - vsPAcount.Left
vsPAcount.Height = ScaleHeight - HScroll.Height - vsPAcount.top
CmdSpliter.top = ScaleHeight - HScroll.Height
CmdCurPage.top = ScaleHeight - HScroll.Height
CmdZoom.top = ScaleHeight - HScroll.Height
CmdPaper.top = ScaleHeight - HScroll.Height
HScroll.top = ScaleHeight - HScroll.Height
HScroll.width = vsPAcount.ScaleWidth - (CmdCurPage.width - 15) * 3 - CmdSpliter.width
VScroll.Height = vsPAcount.ScaleHeight - 4 * (CmdPage(0).Height - 15)
VScroll.Left = ScaleWidth - VScroll.width
For i = 0 To 3
CmdPage(i).Left = VScroll.Left
CmdPage(i).top = VScroll.Height + VScroll.top + i * CmdPage(i).Height
Next
LSpliter.Height = Me.ScaleHeight
Picpage.Height = ScaleHeight - HSpage.Height - vsPAcount.top
HSpage.top = ScaleHeight - HSpage.Height
VSpage.Height = Picpage.Height
InitScrollbar
End Sub
Private Sub InitScrollbar()
Dim i As Integer
i = (PicPaper.ScaleWidth - vsPAcount.ScaleWidth + 180) / Screen.TwipsPerPixelX
If i > 0 Then
HScroll.Max = i
HScroll.Enabled = True
Else
HScroll.Enabled = False
PicPaper.Left = 0
VScroll.Value = 0
End If
i = (PicPaper.ScaleHeight - vsPAcount.ScaleHeight + 180) / Screen.TwipsPerPixelY
If i > 0 Then
VScroll.Max = i
VScroll.Enabled = True
Else
VScroll.Enabled = False
VScrol
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -