⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 itemclass.cls

📁 金算盘软件代码
💻 CLS
📖 第 1 页 / 共 5 页
字号:
    Dim lngRowheight As Long
    Dim lngHdc As Long
        
    My.blnRefresh = False
    SeparateLineColor = fccolor.lngGridLineColor   'GRID列分隔线色
    With frmName.GrdCol
        lngHdc = GetDC(.hwnd)
        lngRowheight = .RowHeight(0)
        '画GRID网格线
        For intI = 1 To 40
            '画水平线
            If lngRowheight * intI > .Height Then Exit For
            
            If frmName.GrdCol.Row <> 0 And (intI = frmName.GrdCol.Row - frmName.GrdCol.TopRow + 1 Or intI = frmName.GrdCol.Row - frmName.GrdCol.TopRow + 2) Then
                DrawBLine lngHdc, 0, lngRowheight * intI - Screen.TwipsPerPixelY, _
                           .width, lngRowheight * intI - Screen.TwipsPerPixelY, _
                            C2lng(RGB(0, 0, 255)) 'frmName.lblCaption.ForeColor
            Else
                DrawBLine lngHdc, 0, lngRowheight * intI - Screen.TwipsPerPixelY, _
                           .width, lngRowheight * intI - Screen.TwipsPerPixelY, _
                            SeparateLineColor
            End If
        Next intI
        '画竖线
        For intI = 1 To .Cols - 1
            If .ColWidth(intI) = 0 Or .ColPos(intI) + .ColWidth(intI) >= .width - Screen.TwipsPerPixelX Or (Not .ColIsVisible(intI)) Then
            Else
                '画当前行
                DrawALine lngHdc, .ColPos(intI) + .ColWidth(intI) - 15, 0, _
                                   .ColPos(intI) + .ColWidth(intI) - 15, .Height, _
                                   GridClipRect.Left, GridClipRect.top, GridClipRect.Right, GridClipRect.Bottom, SeparateLineColor
            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
        ReleaseDC frmName.hwnd, lngHdc
    End With
    If frmName.chkPrint(1).Value = 0 Then

    Else
'        frmName.PaintPicture Utility.GetFormResPicture(1024, 0), _
'                frmName.lblCaption.Left + frmName.lblCaption.Width + 30, frmName.LblBack.top
        DrawAIcon frmName.GrdCol.hwnd, frmName.lblCaption.Left + frmName.lblCaption.width, frmName.GrdCol.RowHeight(0), 1024
        Utility.RemoveFormResPicture (1024)
    End If

    My.blnRefresh = True
End Sub
Public Sub DrawReadOnlyCol()
'    Exit Sub
    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
    Dim lngRowheight As Long
    
    With frmName.GrdCol
        lngRowheight = .RowHeight(0)
        lngHdc = GetDC(.hwnd)
        If .RowIsVisible(.Rows - 1) = False Then Exit Sub
        intLeft = 1
        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
                  x1 = .ColPos(i)
                  x2 = .ColPos(i) + .ColWidth(i) - 2 * Screen.TwipsPerPixelX
                  If .RowPos(.Rows - 1) + .RowHeight(.Rows - 1) < .Height Then
                      y1 = .RowPos(.Rows - 1) + lngRowheight
                      y2 = y1 - 2 * Screen.TwipsPerPixelY
                      For intR = 1 To 30
                          y2 = y2 + lngRowheight  '.RowPos(.Rows - 1) + lngRowHeight * intR
                          If y2 > .Height Then
                             y2 = y2 - lngRowheight
                             Exit For
                          End If
                      Next intR
                      DrawABox lngHdc, x1, y1, x2, y2, RGB(192, 192, 192), RGB(192, 192, 192)
                  End If
               End If
            End If
        Next i
        ReleaseDC .hwnd, lngHdc
    End With
    If frmName.chkPrint(1).Value = 1 Then
        DrawAIcon frmName.GrdCol.hwnd, frmName.lblCaption.Left + frmName.lblCaption.width, lngRowheight, 1024
        Utility.RemoveFormResPicture (1024)
    End If
End Sub
Private Sub DrawShadow(Optional ByVal blnErase As Boolean = False)
    Dim lngColor As Long
    Dim lngHdc As Long
    Dim intI As Integer
    With frmName
    
    '画阴影
    If blnErase = True Then
        lngColor = RGB(192, 192, 192)
    Else
        lngColor = RGB(128, 128, 128)
    End If
    lngHdc = GetDC(.hwnd)
    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
'    Debug.Print Timer
    '画阴影
    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, fccolor.lngCaptionForeColor
    '画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, .lblNote(0).top + .lblNote(0).Height + 2 * 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, _
                            .lblNote(0).top + .lblNote(0).Height + 2 * 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, .lblNote(0).top + .lblNote(0).Height + 2 * Screen.TwipsPerPixelY, _
                    FormClipRect.Left, FormClipRect.top, FormClipRect.Right, FormClipRect.Bottom, lngColor
    End If
    '画备注框
        lngColor = fccolor.lngGridBorderColor
        DrawABox lngHdc, .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 + 0 * Screen.TwipsPerPixelY, _
                           lngColor
    If .LblMemo(3).Visible Then
        DrawABox lngHdc, .LblMemo(3).Left - Screen.TwipsPerPixelX, _
                           .LblMemo(3).top - Screen.TwipsPerPixelY, _
                           .LblMemo(3).Left + .LblMemo(3).width + 1 * Screen.TwipsPerPixelX, _
                           .LblMemo(1).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 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
            Else
                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, lngBackColor
            End If
        Next intI
    End If
    '画备注快捷键的下画线
    If blnErase = True Then
        lngColor = fccolor.lngBackColor
    Else
        lngColor = fccolor.lngFooterForeColor
    End If
    intI = 0
    DrawBLine lngHdc, .LblMemo(0).Left + .LblMemo(0).width - 2 * .FontSize * 10 - 1 * Screen.TwipsPerPixelX, .LblMemo(0).top + .LblMemo(0).Height, _
        .LblMemo(0).Left + .LblMemo(0).width - 1 * .FontSize * 10 - 1 * Screen.TwipsPerPixelX, .LblMemo(0).top + .LblMemo(intI).Height, lngColor
    If frmName.LblMemo(2).Visible Then
        DrawBLine lngHdc, .LblMemo(2).Left + .LblMemo(2).width - 2 * .FontSize * 10 - 1 * Screen.TwipsPerPixelX, .LblMemo(2).top + .LblMemo(2).Height, _
            .LblMemo(2).Left + .LblMemo(2).width - 1 * .FontSize * 10 - 1 * Screen.TwipsPerPixelX, .LblMemo(2).top + .LblMemo(2).Height, lngColor
    End If
    #If conWan = 1 Then
    #End If
    '画合计栏上的竖线
    If blnErase = True Then
        lngColor = fccolor.lngBackColor
    Else
        lngColor = fccolor.lngGridLineColor
    End If
    DrawTotalLine lngHdc, FormClipRect.Left, FormClipRect.top, FormClipRect.Right, FormClipRect.Bottom, lngColor
    ReleaseDC .hwnd, lngHdc
    End With
End Sub
Private Sub DrawAllButton()
    Dim i As Integer
    Dim lngHdc As Long
    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 - 1 * Screen.TwipsPerPixelX, _
                            .lblField(i).top, intButtonWidth, .lblField(i).Height - Screen.TwipsPerPixelY, 0, lngBackColor, _
                            FormClipRect.Left, FormClipRect.top, FormClipRect.Right, FormClipRect.Bottom
        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 - 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
            i = 3
             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
        End If
        If .lblNote(5).Visible Then
            i = 5
                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
            
        End If
    End If
    
    '画备注行按纽
    i = 3
    If .LblMemo(i).Visible Then
        DrawAButton lngHdc, .LblMemo(i).Left + .LblMemo(i).width - intButtonWidth + 1 * Screen.TwipsPerPixelX, _
                    .LblMemo(i).top - 1 * Screen

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -