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

📄 submitadjust.cls

📁 金算盘软件代码
💻 CLS
📖 第 1 页 / 共 5 页
字号:
        End If
    End If
    
    '画备注行按纽
'    i = 3
'    If .lblmemo(i).Visible Then
'        DrawAButton lnghdc, .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
    ReleaseDC .hWnd, lngHdc
    End With
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
        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
Public 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
Public 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 = fccolor.lngBackColor 'RGB(255, 255, 255)
                        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控件一起调整)
            lngPosition(0, 2) = lngPosition(0, 3)
            lngPosition(1, 2) = lngPosition(1, 3)
            lngPosition(2, 2) = lngPosition(2, 3)
            lngPosition(3, 2) = lngPosition(3, 3)
            lngPosition(4, 2) = lngPosition(2, 3) + lngPosition(3, 3) + SPACETWIPS
            lngPosition(5, 2) = lngPosition(4, 2)
            lngPosition(6, 2) = lngPosition(2, 2)
            lngPosition(7, 2) = lngPosition(3, 2)
            lngPosition(8, 2) = lngPosition(1, 2)
            lngPosition(9, 2) = lngPosition(0, 2)
End Sub
Private Function blnFieldButtonAdjust() As Boolean
   '将FIELDBUTTON的位置LEFT,TOP,WIDTH 存于数组LNGPOSITION之第0,1,2列
   '如第四行不可见返回FALSE,否则返回TRUE
   
    Dim bln4RowIsVisible As Boolean
    Dim i As Integer, j As Integer
    Dim lngTop As Long, lngLeft As Long
    
    For i = 0 To frmName.lblField.UBound
        lngPosition(i, 2) = ((Field(i).bytMinSize * frmName.FontSize * 10) \ Screen.TwipsPerPixelX) * Screen.TwipsPerPixelX  '最小宽度
        lngPosition(i, 3) = ((Field(i).bytFieldSize * frmName.FontSize * 10) \ Screen.TwipsPerPixelX) * Screen.TwipsPerPixelX '最大宽度
    Next i
    
'    For i = 1 To 4
        RowAdjust (i)     '行宽度调整
'    Next i
        
    lngPosition(0, 0) = 8 * Screen.TwipsPerPixelX
    lngPosition(0, 1) = frmName.LblBack.top + 3 * Screen.TwipsPerPixelX + intCaptionHeight + intFieldHeight + SpaceTwRow
 '   lngPosition(0, 2) = intField0width
    
    lngPosition(1, 0) = lngPosition(0, 0) + lngPosition(0, 2) + 2 * Screen.TwipsPerPixelX 'LEFT
    lngPosition(1, 1) = lngPosition(0, 1)      'TOP
    #If conWan = 1 Then
      lngPosition(2, 0) = ((frmName.ScaleWidth - 3 * Screen.TwipsPerPixelX - lngPosition(2, 2) - (2 + 7) * Screen.TwipsPerPixelX) \ Screen.TwipsPerPixelX) * Screen.TwipsPerPixelX
    #Else
      lngPosition(2, 0) = ((frmName.ScaleWidth - (intCmd0Width + 5 * Screen.TwipsPerPixelX) - 5 * Screen.TwipsPerPixelX _
                        - lngPosition(2, 2) - (2 + 7) * Screen.TwipsPerPixelX) \ Screen.TwipsPerPixelX) * Screen.TwipsPerPixelX     'LEFT
    #End If
    lngPosition(2, 1) = frmName.LblBack.top + 3 * Screen.TwipsPerPixelY          'TOP
    
    For i = 3 To frmName.lblField.Count - 1
        If Field(i).bytRow = Field(i - 1).bytRow Then
            lngPosition(i, 1) = lngPosition(i - 1, 1)        ' TOP
            If Field(i - 1).blnVisible Then
                'LEFT
                lngPosition(i, 0) = lngPosition(i - 1, 0) - lngPosition(i, 2) - SPACETWIPS
            Else
                'LEFT
                lngPosition(i, 0) = lngPosition(i - 1, 0) + lngPosition(i - 1, 2) - lngPosition(i, 2)
            End If
        Else
            lngPosition(i, 1) = lngPosition(i - 1, 1) + intCaptionHeight + intFieldHeight + SpaceTwRow
            lngPosition(i, 0) = lngPosition(2, 0) + lngPosition(2, 2) - lngPosition(i, 2)
        End If
        
        If Field(i).bytRow = 4 And Field(i).blnVisible Then
            bln4RowIsVisible = True
        End If
    Next i
    lngPosition(9, 0) = lngPosition(0, 0)
    lngPosition(8, 0) = lngPosition(1, 0)
    
    blnFieldButtonAdjust = bln4RowIsVisible
End Function
Private Sub FieldButton()
    On Error Resume Next
    If frmName.Visible = False Then Exit Sub
    If frmName.WindowState = 1 Then Exit Sub
    If frmName.width < lngDefaultWidth Then
        frmName.width = lngDefaultWidth
    End If
    If frmName.Height < lngDefaultHeight Then
        frmName.Height = lngDefaultHeight
    End If
    On Error GoTo 0
'fields控件位置调整
    Dim i As Integer
    Dim bln4RowIsVisible
    Dim lngHeight As Long
    Dim lngMemoTop As Long
    Dim lngTop As Long
    Dim lngButtom As Long
    bln4RowIsVisible = False
'    DrawShadow True   '消影
'    DrawTotalBox True
    
    '调底版
    
    With frmName
        .lblCaption.Visible = True
        #If conWan = 1 Then
            .LblBack.Move 3 * Screen.TwipsPerPixelX, .LblBack.top, .ScaleWidth - 8 * Screen.TwipsPerPixelX, .ScaleHeight - .LblBack.top - (3 + 5) * Screen.TwipsPerPixelY
        #Else
            .LblBack.Move 3 * Screen.TwipsPerPixelX, _
                        .LblBack.top, _
                        .ScaleWidth - intCmd0Width - (5 + 3 + 5 + 3) * Screen.TwipsPerPixelX, _
                        .ScaleHeight - .LblBack.top - (3 + 5) * Screen.TwipsPerPixelY
        #End If
        '调FIELD区
        '根据已开发票标志设置发票类型及发票号输入框可视性
        If .LblBack.Visible = False Then .LblBack.Visible = True
        bln4RowIsVisible = blnFieldButtonAdjust
        For i = 0 To .lblField.UBound
            .lblFieldCaption(i).Move lngPosition(i, 0), lngPosition(i, 1), lngPosition(i, 2)
            If i <= 1 Then
                    .lblField(i).Move lngPosition(i, 0), _
                            lngPosition(i, 1) + intCaptionHeight, _
                            lngPosition(i, 2), _
                            intCaptionHeight + intFieldHeight * 2 + SpaceTwRow
            Else
                .lblField(i).Move lngPosition(i, 0), _
                             lngPosition(i, 1) + intCaptionHeight, _
                             lngPosition(i, 2)
            End If
        Next i
        For i = 0 To .lblField.Count - 1
             .lblField(i).Visible = Field(i).blnVisible
             .lblFieldCaption(i).Visible = .lblField(i).Visible
        Next i
         
         lngMemoTop = .LblBack.top + .LblBack.Height - .LblMemo(0).Height - 6 * Screen.TwipsPerPixelY
                
        '调备注行
        
        .LblMemo(.LblMemo.Count - 1).Move .LblBack.Left + .LblBack.width - 3 * Screen.TwipsPerPixelX - .LblMemo(.LblMemo.Count - 1).width, _
                   lngMemoTop
        .LblMemo(.LblMemo.Count - 2).Move .LblMemo(.LblMemo.Count - 1).Left - 3 * Screen.TwipsPerPixelX - .LblMemo(.LblMemo.Count - 2).width, _
                          lngMemoTop
        
        .LblMemo(0).Move .LblBack.Left + 6 * Screen.TwipsPerPixelX, _
                     lngMemoTop
        If Not .LblMemo(2).Visible Then
            .LblMemo(1).Move .LblMemo(0).Left + .LblMemo(0).width + 3 * Screen.TwipsPerPixelX, _
                         lngMemoTop, _
                         .LblMemo(4).Left - 6 * Screen.TwipsPerPixelX - (.LblMemo(0).Left + .LblMemo(0).width + 3 * Screen.TwipsPerPixelX)
        Else
            .LblMemo(3).Move .LblMemo(4).Left - .LblMemo(3).width - 3 * Screen.TwipsPerPixelX, _
                         lngMemoTop
            .LblMemo(2).Move .LblMemo(3).Left - .LblMemo(2).width - 3 * Screen.TwipsPerPixelX, _
                         lngMemoTop
            .LblMemo(1).Move .LblMemo(0).Left + .LblMemo(0).width + 3 * Screen.TwipsPerPixelX, _
                         lngMemoTop, _
                         .LblMemo(2).Left - 6 * Screen.TwipsPerPixelX - (.LblMemo(0).Left + .LblMemo(0).width + 3 * Screen.TwipsPerPixelX)
        End If
        If .LblMemo(0).Visible = False Then .LblMemo(0).Visible = True
        If .LblMemo(1).Visible = False Then .LblMemo(1).Visible = True
        If .LblMemo(4).Visible = False Then .LblMemo(4).Visible = True
        If .LblMemo(5).Visible = False Then .LblMemo(5).Visible = True
        
        '调说明行
        .lblNote(0).Move .LblBack.Left + 14 * Screen.TwipsPerPixelX, _
                        .LblMemo(0).top - .lblNote(0).Height - 10 * Screen.TwipsPerPixelY
        
        .lblNote(1).Move .lblNote(0).Left + .lblNote(0).width + 5 * Screen.TwipsPerPixelX, _
                        .lblNote(0).top, _
                        .LblBack.Left + .LblBack.width + 5 * Screen.TwipsPerPixelX _
                        - (2 * 3 + 5) * Screen.TwipsPerPixelX - (.lblNote(0).Left + .lblNote(0).width + 5 * Screen.TwipsPerPixelX) - 7 * Screen.TwipsPerPixelX, .lblNote(0).Height
        If .lblNote(0).Visible = False Then .lblNote(0).Visible = True
        If .lblNote(1).Visible = False Then .lblNote(1).Visible = True
    
        
        .lblTotal(1).Caption = "合计"
        
        '调GRID
        .GrdCol.Redraw = False
        lngTop = lngGrdTop(bln4RowIsVisible) + 3 * Screen.TwipsPerPixelY
        lngButtom = .lblNote(0).top - 6 * Screen.TwipsPerPixelY - .GrdCol.RowHeight(0)
        
        #If

⌨️ 快捷键说明

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