📄 submitadjust.cls
字号:
End If
Next intI
'画按纽
If My.bytRegion = FGrid And False Then
For intI = .LeftCol To .Cols - 1
If (Not ColProperty(intI).blnReadOnly) And (ColProperty(intI).lngCtrType = TRefer Or ColProperty(intI).lngCtrType = tdate) And .ColIsVisible(intI) And .ColWidth(intI) <> 0 And .ColPos(intI) + .ColWidth(intI) < .width Then
DrawAButton lngHdc, .ColPos(intI) + .ColWidth(intI) - intButtonWidth - 2 * Screen.TwipsPerPixelX, _
.RowPos(.Row) + 1 * Screen.TwipsPerPixelY, intButtonWidth, .RowHeight(0) - 2 * Screen.TwipsPerPixelY, 0, _
GridClipRect.Left, GridClipRect.top, GridClipRect.Right, GridClipRect.Bottom
End If
Next intI
End If
For intI = 1 To 40
'画水平线
If .RowHeight(0) * intI > .Height Then Exit For
If .Row > 0 And (intI = .Row - .TopRow + 1 Or intI = .Row + 1 - .TopRow + 1) Then
DrawBLine lngHdc, 0, .RowHeight(0) * intI - Screen.TwipsPerPixelY, _
.width, .RowHeight(0) * intI - Screen.TwipsPerPixelY, _
CLng(RGB(0, 0, 255))
Else
DrawBLine lngHdc, 0, .RowHeight(0) * intI - Screen.TwipsPerPixelY, _
.width, .RowHeight(0) * intI - Screen.TwipsPerPixelY, _
SeparateLineColor
End If
Next intI
ReleaseDC .hWnd, lngHdc
End With
My.blnRefresh = True
End Sub
Public Sub DrawReadOnlyCol()
Dim intLeft As Integer
Dim i As Integer
Dim intR As Integer
Dim x1 As Long, x2 As Long, y1 As Long, y2 As Long
Dim lngHdc As Long
With frmName.GrdCol
lngHdc = GetDC(.hWnd)
If .RowIsVisible(.Rows - 1) = False Then GoTo OK
intLeft = .LeftCol
If intLeft = 0 Then intLeft = 1
For i = intLeft To .Cols - 1
If ColProperty(i).blnReadOnly Then
If .ColIsVisible(i) And .ColWidth(i) <> 0 Then
If .RowPos(.Rows - 1) + .RowHeight(.Rows - 1) < .Height Then
For intR = 1 To 30
x1 = .ColPos(i)
y1 = .RowPos(.Rows - 1) + .RowHeight(0) * intR
If y1 > .Height Then Exit For
x2 = .ColPos(i) + .ColWidth(i) - 2 * Screen.TwipsPerPixelX
y2 = y1 + .RowHeight(0) - 2 * Screen.TwipsPerPixelY
DrawABox lngHdc, x1, y1, x2, y2, _
RGB(192, 192, 192), RGB(192, 192, 192)
Next intR
End If
End If
End If
Next i
ReleaseDC .hWnd, lngHdc
End With
OK:
If frmName.chkPrint(1).Value <> 0 Then
With frmName.GrdCol
DrawAIcon .hWnd, .Left + (.width - 140 * Screen.TwipsPerPixelX) \ 2, .RowHeight(0) + (.Height - .RowHeight(0) - 70 * Screen.TwipsPerPixelY) \ 2, 1024
End With
Utility.RemoveFormResPicture (1024)
End If
End Sub
Private Sub DrawShadow(Optional ByVal blnErase As Boolean = False)
Dim lngColor As Long
Dim intI As Integer
Dim lngHdc As Long
With frmName
lngHdc = GetDC(.hWnd)
'画阴影
If blnErase = True Then
lngColor = RGB(192, 192, 192)
Else
lngColor = RGB(128, 128, 128)
End If
DrawABox lngHdc, .LblBack.Left + .LblBack.width, _
.LblBack.top + 3 * Screen.TwipsPerPixelY, _
.LblBack.Left + .LblBack.width + 2 * Screen.TwipsPerPixelX, _
.LblBack.top + .LblBack.Height + 3 * Screen.TwipsPerPixelY, _
lngColor, True
DrawABox lngHdc, .LblBack.Left + 3 * Screen.TwipsPerPixelX, _
.LblBack.top + .LblBack.Height + 0 * Screen.TwipsPerPixelY, _
.LblBack.Left + .LblBack.width + 0 * Screen.TwipsPerPixelX, _
.LblBack.top + .LblBack.Height + 3 * Screen.TwipsPerPixelY, _
lngColor, True
'画快捷键的下画线
If blnErase = True Then
lngColor = RGB(192, 192, 192)
Else
lngColor = RGB(0, 0, 0)
End If
For intI = 0 To 4 Step 2
DrawBLine lngHdc, .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
ReleaseDC .hWnd, lngHdc
End With
End Sub
Public Sub DrawTotalBox(Optional ByVal blnErase As Boolean = False)
Dim intI As Integer
Dim lngColor As Long
Dim lngHdc As Long
With frmName
lngHdc = GetDC(.hWnd)
'画阴影
If blnErase = True Then
lngColor = RGB(192, 192, 192)
Else
lngColor = RGB(128, 128, 128)
End If
DrawABox lngHdc, .LblBack.Left + .LblBack.width, _
.LblBack.top + 3 * Screen.TwipsPerPixelY, _
.LblBack.Left + .LblBack.width + 2 * Screen.TwipsPerPixelX, _
.LblBack.top + .LblBack.Height + 3 * Screen.TwipsPerPixelY, _
lngColor, True
DrawABox lngHdc, .LblBack.Left + 3 * Screen.TwipsPerPixelX, _
.LblBack.top + .LblBack.Height + 0 * Screen.TwipsPerPixelY, _
.LblBack.Left + .LblBack.width + 0 * Screen.TwipsPerPixelX, _
.LblBack.top + .LblBack.Height + 3 * Screen.TwipsPerPixelY, _
lngColor, True
'画标题下的横线
If blnErase = True Then
lngColor = fccolor.lngBackColor
Else
lngColor = fccolor.lngCaptionForeColor
End If
DrawALine lngHdc, .lblCaption.Left, .lblCaption.top + .lblCaption.Height + 2 * Screen.TwipsPerPixelY, _
.lblCaption.Left + .lblCaption.width, .lblCaption.top + .lblCaption.Height + 2 * Screen.TwipsPerPixelY, _
FormClipRect.Left, FormClipRect.top, FormClipRect.Right, FormClipRect.Bottom, lngColor
' '画合计栏上的竖线
' If blnErase = True Then
' lngColor = fccolor.lngBackColor
' Else
' lngColor = SeparateLineColor
' End If
' For inti = 1 To .grdCol.Cols - 1
' If .grdCol.ColPos(inti) + .grdCol.ColWidth(inti) >= .grdCol.width - Screen.TwipsPerPixelX Or (Not .grdCol.ColIsVisible(inti)) Then
' Else
' DrawALine lngHdc, .grdCol.Left + .grdCol.ColPos(inti) + .grdCol.ColWidth(inti) - Screen.TwipsPerPixelX, .grdCol.top + .grdCol.Height, _
' .grdCol.Left + .grdCol.ColPos(inti) + .grdCol.ColWidth(inti) - Screen.TwipsPerPixelX, .grdCol.top + .grdCol.Height + .grdCol.RowHeight(0), _
' 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
DrawABox lngHdc, .GrdCol.Left - Screen.TwipsPerPixelX, .GrdCol.top - 1 * Screen.TwipsPerPixelY, _
.GrdCol.Left + .GrdCol.width - 0 * Screen.TwipsPerPixelX, .LblMemo(0).top - 7 * Screen.TwipsPerPixelY, lngColor
DrawABox lngHdc, .GrdCol.Left - Screen.TwipsPerPixelX - 2 * Screen.TwipsPerPixelX, _
.GrdCol.top - 1 * Screen.TwipsPerPixelY - 2 * Screen.TwipsPerPixelY, _
.GrdCol.Left + .GrdCol.width - 0 * Screen.TwipsPerPixelX + 2 * Screen.TwipsPerPixelX, _
.LblMemo(0).top - 7 * Screen.TwipsPerPixelY + 2 * Screen.TwipsPerPixelY, _
lngColor
If blnErase = True Then
lngColor = fccolor.lngBackColor
DrawBLine lngHdc, .GrdCol.Left, .GrdCol.top + .GrdCol.Height + 0, _
.GrdCol.Left + .GrdCol.width, .GrdCol.top + .GrdCol.Height + 0, lngColor
DrawBLine lngHdc, .GrdCol.Left, .GrdCol.top + .GrdCol.Height + .GrdCol.RowHeight(0) + 0, _
.GrdCol.Left + .GrdCol.width, .GrdCol.top + .GrdCol.Height + .GrdCol.RowHeight(0) + 0, lngColor
DrawBLine lngHdc, .lblNote(0).Left + .lblNote(0).width + 2 * Screen.TwipsPerPixelX, .GrdCol.top + .GrdCol.Height, _
.lblNote(0).Left + .lblNote(0).width + 2 * Screen.TwipsPerPixelX, .LblMemo(0).top - 2 * Screen.TwipsPerPixelY, lngColor
Else
lngColor = fccolor.lngGridLineColor
DrawALine lngHdc, .GrdCol.Left, .GrdCol.top + .GrdCol.Height + 0, _
.GrdCol.Left + .GrdCol.width, .GrdCol.top + .GrdCol.Height + 0, _
FormClipRect.Left, FormClipRect.top, FormClipRect.Right, FormClipRect.Bottom, lngColor
DrawALine lngHdc, .GrdCol.Left, .GrdCol.top + .GrdCol.Height + .GrdCol.RowHeight(0) + 0, _
.GrdCol.Left + .GrdCol.width, .GrdCol.top + .GrdCol.Height + .GrdCol.RowHeight(0) + 0, _
FormClipRect.Left, FormClipRect.top, FormClipRect.Right, FormClipRect.Bottom, lngColor
DrawALine lngHdc, .lblNote(0).Left + .lblNote(0).width + 2 * Screen.TwipsPerPixelX, .GrdCol.top + .GrdCol.Height + .GrdCol.RowHeight(0), _
.lblNote(0).Left + .lblNote(0).width + 2 * Screen.TwipsPerPixelX, .LblMemo(0).top - 6 * Screen.TwipsPerPixelY, _
FormClipRect.Left, FormClipRect.top, FormClipRect.Right, FormClipRect.Bottom, lngColor
End If
'画备注框
Dim lngX2 As Long
If .LblMemo(2).Visible Then
lngX2 = .LblMemo(3).Left + .LblMemo(3).width + Screen.TwipsPerPixelX
Else
lngX2 = .LblMemo(1).Left + .LblMemo(1).width + Screen.TwipsPerPixelX
End If
If blnErase = True Then
lngColor = fccolor.lngBackColor
DrawABox lngHdc, .LblMemo(0).Left - Screen.TwipsPerPixelX, _
.LblMemo(0).top - Screen.TwipsPerPixelY, _
.LblMemo(4).Left - 2 * Screen.TwipsPerPixelX, _
.LblMemo(0).top + .LblMemo(0).Height + 1 * Screen.TwipsPerPixelY, _
lngColor
For intI = 1 To .LblMemo.Count - 2
If .GrdCol.ColPos(intI) + .GrdCol.ColWidth(intI) >= .GrdCol.width - Screen.TwipsPerPixelX Or (Not .GrdCol.ColIsVisible(intI)) Then Exit For
DrawBLine lngHdc, .LblMemo(intI).Left - Screen.TwipsPerPixelX, _
.LblMemo(1).top - Screen.TwipsPerPixelY, _
.LblMemo(intI).Left - 1 * Screen.TwipsPerPixelX, _
.LblMemo(1).top + .LblMemo(1).Height + 4 * Screen.TwipsPerPixelY, lngColor
Next intI
Else
lngColor = fccolor.lngGridBorderColor
DrawABox lngHdc, .LblMemo(0).Left - Screen.TwipsPerPixelX, _
.LblMemo(0).top - Screen.TwipsPerPixelY, _
.LblMemo(4).Left - 2 * Screen.TwipsPerPixelX, _
.LblMemo(0).top + .LblMemo(0).Height + 1 * Screen.TwipsPerPixelY, _
lngColor
For intI = 1 To .LblMemo.Count - 2
If .GrdCol.ColPos(intI) + .GrdCol.ColWidth(intI) >= .GrdCol.width - Screen.TwipsPerPixelX Or (Not .GrdCol.ColIsVisible(intI)) Then Exit For
If .LblMemo(intI).Visible = False Then Exit For
DrawBLine lngHdc, .LblMemo(intI).Left - Screen.TwipsPerPixelX, _
.LblMemo(1).top - Screen.TwipsPerPixelY, _
.LblMemo(intI).Left - 1 * Screen.TwipsPerPixelX, _
.LblMemo(1).top + .LblMemo(1).Height + Screen.TwipsPerPixelY, lngColor
Next intI
End If
'画制单人方框
With frmName.LblMemo(frmName.LblMemo.Count - 1)
DrawABox lngHdc, .Left - Screen.TwipsPerPixelX, .top - 2 * Screen.TwipsPerPixelY, .Left + .FontSize * 10.05 * StrLen(Trim(.Caption)), .top + .Height - 0 * Screen.TwipsPerPixelY, RGB(255, 0, 0), False
End With
'画快捷键的下画线
If blnErase = True Then
lngColor = RGB(192, 192, 192)
For intI = 0 To 4 Step 2
DrawBLine lngHdc, .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 lngHdc, .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
End If
Next intI
End If
'画备注快捷键的下画线
If blnErase = True Then
lngColor = fccolor.lngBackColor 'RGB(255, 255, 255)
Else
lngColor = fccolor.lngFooterForeColor ' RGB(0, 0, 0)
End If
intI = 0
DrawBLine lngHdc, .LblMemo(0).Left + .LblMemo(0).width - 2 * .FontSize * 10, .LblMemo(0).top + .LblMemo(0).Height - 1 * Screen.TwipsPerPixelY, _
.LblMemo(0).Left + .LblMemo(0).width - 1 * .FontSize * 10, .LblMemo(0).top + .LblMemo(intI).Height - 1 * Screen.TwipsPerPixelY, lngColor
'画合计栏上的竖线
If blnErase = True Then
lngColor = fccolor.lngBackColor
Else
lngColor = SeparateLineColor
End If
DrawTotalLine lngHdc, FormClipRect.Left, FormClipRect.top, FormClipRect.Right, FormClipRect.Bottom, lngColor
' For inti = 1 To .grdCol.Cols - 1
' If .grdCol.ColPos(inti) + .grdCol.ColWidth(inti) >= .grdCol.width - Screen.TwipsPerPixelX Or (Not .grdCol.ColIsVisible(inti)) Then
' Else
' DrawALine lngHdc, .grdCol.Left + .grdCol.ColPos(inti) + .grdCol.ColWidth(inti) - Screen.TwipsPerPixelX, .grdCol.top + .grdCol.Height, _
' .grdCol.Left + .grdCol.ColPos(inti) + .grdCol.ColWidth(inti) - Screen.TwipsPerPixelX, .grdCol.top + .grdCol.Height + .grdCol.RowHeight(0), _
' FormClipRect.Left, FormClipRect.top, FormClipRect.Right, FormClipRect.Bottom, lngColor
' End If
' Next inti
ReleaseDC .hWnd, lngHdc
End With
End Sub
Private Sub DrawAllButton()
Dim i As Integer
Dim lngBackColor As Long
Dim lngHdc As Long
lngBackColor = GetSysColor(COLOR_BTNFACE)
With frmName
lngHdc = GetDC(.hWnd)
'画FIELD区按纽
For i = 1 To .lblField.Count - 1
If .lblField(i).Visible And (Field(i).lngCtrType = tdate Or Field(i).lngCtrType = TRefer) Then
DrawAButton lngHdc, .lblField(i).Left + .lblField(i).width - intButtonWidth, _
.lblField(i).top, intButtonWidth, .lblField(i).Height, 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 lngHdc, .lblHead(i).Left + .lblHead(i).width - intButtonWidth - 2 * Screen.TwipsPerPixelX, _
.lblHead(i).top + 1 * Screen.TwipsPerPixelY, intButtonWidth, .lblHead(i).Height - 2 * 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 lngHdc, .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
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -