📄 clsstartperiod.cls
字号:
lngTop = .lblCaption.top
lngRight = lngLeft + .lblCaption.width
lngButton = lngTop + .lblCaption.Height
DrawALine hdc, lngLeft, lngButton + 2 * Screen.TwipsPerPixelY, _
lngRight, lngButton + 2 * Screen.TwipsPerPixelY, _
FormClipRect.Left, FormClipRect.top, FormClipRect.Right, FormClipRect.Bottom, lngColor
'画合计栏上的竖线
If blnErase = True Then
lngColor = fccolor.lngBackColor
Else
lngColor = fccolor.lngGridLineColor
End If
lngL = .GrdCol.Left
lngTop = .GrdCol.top + .GrdCol.Height
lngButton = lngTop + .GrdCol.RowHeight(0)
intI = 1
lngLeft = .GrdCol.Left + .GrdCol.ColPos(intI) + .GrdCol.ColWidth(intI) - Screen.TwipsPerPixelX
lngWidth = .GrdCol.width
DrawALine hdc, lngLeft, lngTop, lngLeft, lngButton, FormClipRect.Left, FormClipRect.top, FormClipRect.Right, FormClipRect.Bottom, lngColor
For intI = .GrdCol.LeftCol To .GrdCol.Cols - 1
lngLeft = .GrdCol.ColPos(intI) + .GrdCol.ColWidth(intI) - Screen.TwipsPerPixelX
If lngLeft >= lngWidth Then
Exit For
ElseIf (Not .GrdCol.ColIsVisible(intI)) Then
Else
DrawALine hdc, lngL + lngLeft, lngTop, _
lngL + lngLeft, lngButton, _
FormClipRect.Left, FormClipRect.top, FormClipRect.Right, FormClipRect.Bottom, lngColor
End If
Next intI
'画GRID下的表格
'画GRD及合计栏外框
If blnErase = True Then
lngColor = fccolor.lngBackColor
Else
lngColor = fccolor.lngGridBorderColor
End If
lngLeft = lngL
lngRight = lngLeft + .GrdCol.width
lngTop = .GrdCol.top
lngButton = lngTop + .GrdCol.Height
DrawABox hdc, lngL - Screen.TwipsPerPixelX, lngTop - 1 * Screen.TwipsPerPixelY, _
lngRight - 0 * Screen.TwipsPerPixelX, .lblNote(0).top + .lblNote(0).Height + 2 * Screen.TwipsPerPixelY, lngColor
DrawABox hdc, lngL - 3 * Screen.TwipsPerPixelX, _
lngTop - 3 * Screen.TwipsPerPixelY, _
lngRight + 2 * Screen.TwipsPerPixelX, _
.lblNote(0).top + .lblNote(0).Height + 4 * Screen.TwipsPerPixelY, _
lngColor
If blnErase = True Then
lngColor = fccolor.lngBackColor
DrawBLine hdc, lngLeft, lngButton + 0, _
lngRight, lngButton + 0, lngColor
DrawBLine hdc, lngLeft, lngButton + .GrdCol.RowHeight(0) + 0, _
lngRight, lngButton + .GrdCol.RowHeight(0) + 0, lngColor
DrawBLine hdc, .lblNote(0).Left + .lblNote(0).width + 2 * Screen.TwipsPerPixelX, lngButton, _
.lblNote(0).Left + .lblNote(0).width + 2 * Screen.TwipsPerPixelX, .LblMemo(0).top - 2 * Screen.TwipsPerPixelY, lngColor
Else
lngColor = fccolor.lngGridLineColor
DrawALine hdc, lngLeft, lngButton, _
lngRight, lngButton + 0, _
FormClipRect.Left, FormClipRect.top, FormClipRect.Right, FormClipRect.Bottom, lngColor
DrawALine hdc, lngLeft, lngButton + .GrdCol.RowHeight(0) + 0, _
lngRight, lngButton + .GrdCol.RowHeight(0) + 0, _
FormClipRect.Left, FormClipRect.top, FormClipRect.Right, FormClipRect.Bottom, lngColor
DrawALine hdc, .lblNote(0).Left + .lblNote(0).width + 2 * Screen.TwipsPerPixelX, lngButton + .GrdCol.RowHeight(0), _
.lblNote(0).Left + .lblNote(0).width + 2 * Screen.TwipsPerPixelX, .lblNote(0).top + .lblNote(0).Height + 2 * Screen.TwipsPerPixelY, _
FormClipRect.Left, FormClipRect.top, FormClipRect.Right, FormClipRect.Bottom, lngColor
End If
'画备注框
lngColor = fccolor.lngGridBorderColor
DrawABox hdc, .LblMemo(1).Left - Screen.TwipsPerPixelX, _
.LblMemo(1).top - Screen.TwipsPerPixelY, _
.LblMemo(1).Left + .LblMemo(1).width + 1 * Screen.TwipsPerPixelX, _
.LblMemo(1).top + .LblMemo(1).Height - 1 * Screen.TwipsPerPixelY, _
lngColor
If .LblMemo(3).Visible Then
DrawABox hdc, .LblMemo(3).Left - Screen.TwipsPerPixelX, _
.LblMemo(3).top - Screen.TwipsPerPixelY, _
.LblMemo(3).Left + .LblMemo(3).width + 1 * Screen.TwipsPerPixelX, _
.LblMemo(3).top + .LblMemo(3).Height - 1 * Screen.TwipsPerPixelY, _
lngColor
End If
'画快捷键的下画线
If blnErase = True Then
lngColor = RGB(192, 192, 192)
For intI = 0 To 4 Step 2
DrawBLine hdc, .lblHead(intI).Left + .lblHead(intI).width - 2 * .FontSize * 10, .lblHead(intI).top + .lblHead(intI).Height + 0, _
.lblHead(intI).Left + .lblHead(intI).width - 1 * .FontSize * 10, .lblHead(intI).top + .lblHead(intI).Height + 0, lngColor
Next intI
Else
lngColor = RGB(0, 0, 0)
For intI = 0 To 4 Step 2
If .lblHead(intI).Visible Then
DrawALine hdc, .lblHead(intI).Left + .lblHead(intI).width - 2 * .FontSize * 10, .lblHead(intI).top + .lblHead(intI).Height + 0, _
.lblHead(intI).Left + .lblHead(intI).width - 1 * .FontSize * 10, .lblHead(intI).top + .lblHead(intI).Height + 0, _
FormClipRect.Left, FormClipRect.top, FormClipRect.Right, FormClipRect.Bottom, lngColor
Else
DrawALine hdc, .lblHead(intI).Left + .lblHead(intI).width - 2 * .FontSize * 10, .lblHead(intI).top + .lblHead(intI).Height + 0, _
.lblHead(intI).Left + .lblHead(intI).width - 1 * .FontSize * 10, .lblHead(intI).top + .lblHead(intI).Height + 0, _
FormClipRect.Left, FormClipRect.top, FormClipRect.Right, FormClipRect.Bottom, lngBackColor
End If
Next intI
End If
' '画备注快捷键的下画线
' If blnErase = True Then
' lngColor = fccolor.lngBackColor
' Else
' lngColor = fccolor.lngFooterForeColor
' End If
' intI = 0
' DrawBLine .hwnd, .lblmemo(0).Left + .lblmemo(0).Width - 2 * .FontSize * 10, .lblmemo(0).top + .lblmemo(0).Height - 60, _
' .lblmemo(0).Left + .lblmemo(0).Width - 1 * .FontSize * 10, .lblmemo(0).top + .lblmemo(intI).Height - 60, lngColor
ReleaseDC .hwnd, hdc
End With
End Sub
Private Sub DrawAllButton(ByVal hdc As Long)
Dim i As Integer
' Dim lngBackColor As Long
' lngBackColor = GetSysColor(COLOR_BTNFACE)
With frmName
'画FIELD区按纽
For i = 1 To .lblField.Count - 1
If .lblField(i).Visible And (Field(i).lngCtrType = tdate Or Field(i).lngCtrType = TRefer) Then
DrawAButton hdc, .lblField(i).Left + .lblField(i).width - intButtonWidth - 1 * Screen.TwipsPerPixelX, _
.lblField(i).top, intButtonWidth, .lblField(i).Height - Screen.TwipsPerPixelY, 0, lngBackColor, _
FormClipRect.Left, FormClipRect.top, FormClipRect.Right, FormClipRect.Bottom
' DrawAButton .hWnd, .lblField(i).Left + .lblField(i).Width - intButtonWidth, _
' .lblField(i).Top, intButtonWidth, .lblField(i).Height, 0
End If
Next i
'画HEAD行按纽
For i = 1 To .lblHead.Count - 1 Step 2
If .lblHead(i).Visible Then
DrawAButton hdc, .lblHead(i).Left + .lblHead(i).width - intButtonWidth - 4 * Screen.TwipsPerPixelX, _
.lblHead(i).top + 1 * Screen.TwipsPerPixelY, intButtonWidth + 2 * Screen.TwipsPerPixelX, .lblHead(i).Height - 3 * Screen.TwipsPerPixelY, 0, lngBackColor, _
FormClipRect.Left, FormClipRect.top, FormClipRect.Right, FormClipRect.Bottom
End If
Next i
'画Field0处所粘贴行输入按纽
If .lblNote.Count >= 6 Then
If .lblNote(3).Visible Then
For i = 3 To .lblNote.Count - 1 Step 2
DrawAButton hdc, .lblNote(i).Left + .lblNote(i).width - intButtonWidth - 0 * Screen.TwipsPerPixelX, _
.lblNote(i).top + 0 * Screen.TwipsPerPixelY, intButtonWidth, .lblNote(i).Height - 0 * Screen.TwipsPerPixelY, 0, lngBackColor, _
FormClipRect.Left, FormClipRect.top, FormClipRect.Right, FormClipRect.Bottom
Next i
End If
End If
'画备注行按纽
i = 3
If .LblMemo(i).Visible Then
DrawAButton hdc, .LblMemo(i).Left + .LblMemo(i).width - intButtonWidth - 0 * Screen.TwipsPerPixelX, _
.LblMemo(i).top - 1 * Screen.TwipsPerPixelY, intButtonWidth, .LblMemo(i).Height + 1 * Screen.TwipsPerPixelY, 0, lngBackColor, _
FormClipRect.Left, FormClipRect.top, FormClipRect.Right, FormClipRect.Bottom
End If
End With
End Sub
Public Sub InvoiceWithBill(ByVal blnInvoiceExit As Boolean)
'开票标志改变后重新调整模板
If C2lng(frmName.lblHead(2).Tag) = 8 Or C2lng(frmName.lblHead(2).Tag) = 20 Then Exit Sub '采购销售发票
If blnInvoiceExit Then
frmName.lblFieldCaption(13).Caption = Field(13).strFieldName
frmName.lblFieldCaption(14).Caption = Field(14).strFieldName
Field(13).blnVisible = True
Field(14).blnVisible = True
Else
Field(13).blnVisible = False
Field(14).blnVisible = False
With frmName
.lblField(13).Visible = False
.lblFieldCaption(13).Visible = False
.lblField(14).Visible = False
.lblFieldCaption(14).Visible = False
End With
End If
MemoAndNote blnInvoiceExit
FieldButtonNew
End Sub
Private Sub GrdAndLabelInitial()
'列表及LABEL控件初始化
Dim intI As Integer
Dim i%
'--------------------------
'应付单只显示1--5列
'--------------------------
With frmName.GrdCol
.ColWidth(0) = 0
' For inti = 5 To .cols - 1
' .ColWidth(inti) = 0
' Next inti
For intI = 1 To .Cols - 1
If ColProperty(intI).blnUsable Then
.ColWidth(intI) = ColProperty(intI).lngColWidth
Else
.ColWidth(intI) = 0
End If
If ColProperty(intI).lngCtrType = tCurrency Then
.ColAlignment(intI) = 7
If frmName.lblTotal.Count > intI Then
If intI = 1 Then
frmName.lblTotal(intI).Alignment = 2
Else
frmName.lblTotal(intI).Alignment = 1
End If
End If
Else
.ColAlignment(intI) = 1
End If
.Row = 0
.col = intI
' .CellBackColor = frmName.lblFieldCaption(1).BackColor
' .CellForeColor = frmName.lblFieldCaption(1).ForeColor
Next intI
ReadonlyColBackColor
End With
For intI = 0 To frmName.lblField.UBound
If Field(intI).lngCtrType = tCurrency Then frmName.lblField(intI).Alignment = 1
If intI = 0 Then
frmName.lblField(intI).WordWrap = True
Else
frmName.lblField(intI).WordWrap = False
End If
Next intI
End Sub
Private Sub CurrRedWord()
'对普通GRD内容中金额为负数的单元做红字显示处理
Dim intI As Integer
Dim i%
Dim strText As String
My.blnRefresh = False
With frmName.GrdCol
If .Rows > .FixedRows Then
For intI = .FixedCols To .Cols - 1
If .ColWidth(intI) > 0 And ColProperty(intI).lngCtrType = tCurrency And ColProperty(intI).blnReadOnly = False Then
For i% = 1 To .Rows - 1
If C2Dbl(TextMatrix(i%, intI)) < 0 Then
strText = TextMatrix(i%, intI)
WriteGrd strText, i%, intI
End If
Next i%
End If
Next intI
End If
End With
My.blnRefresh = True
End Sub
Private Sub ReadonlyColBackColor()
'设只读列背静色
Dim intI As Integer
Dim i%
Dim blnTmp As Boolean
blnTmp = My.blnRefresh
My.blnRefresh = False
With frmName.GrdCol
If .Rows > .FixedRows Then
For i% = 1 To .Cols - 1
For intI = .FixedRows To .Rows - 1
If .ColWidth(i%) > 0 Then
.col = i%
.Row = intI
If ColProperty(i%).blnReadOnly Then
.CellBackColor = RGB(192, 192, 192)
Else
.CellBackColor = .BackColor
End If
End If
Next intI
Next i%
End If
End With
My.blnRefresh = blnTmp
End Sub
Private Function lngGrdTop(ByVal bln4RowVisible As Boolean) As Long
Dim lngTop As Long
Dim i As Integer
Dim j As Integer
j = 1
If bln4RowVisible Then
lngTop = frmName.lblField(frmName.lblField.Count - 1).top + frmName.lblField(frmName.lblField.Count - 1).Height + SpaceTwRow * 2
GoTo EndProc
End If
If Field(0).blnVisible Then
lngTop = frmName.lblFieldCaption(frmName.lblField.Count - 1).top + SpaceTwRow
GoTo EndProc
End If
For i = frmName.lblField.Count - 1 To 1 Step -1
If Field(i).blnVisible Then
j = i
Exit For
End If
Next i
lngTop = frmName.lblField(j).top + frmName.lblField(j).Height + SpaceTwRow * 2
EndProc:
lngGrdTop = lngTop
End Function
Private Sub RowAdjust(ByVal intRow As Integer)
'调整一行的LABEL控件宽度(第0号LABEL控件宽度与第第2,3行LABEL控件一起调整)
Dim lngRowUsableWidth As Long
Dim lngSumWidth As Long
Dim lngSumMaxWidth As Long
Dim lngOneAdded As Long
Dim intVisibleNO As Integer
Dim i As Integer
Dim intFirstIndex As Integer
Dim intEndIndex As Integer
intFirstIndex = 0
'行总可用宽度
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -