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

📄 frmvoucher.frm

📁 金算盘软件代码
💻 FRM
📖 第 1 页 / 共 5 页
字号:
        Me.width = lngDefaultWidth
    End If
    If Me.Height < lngDefaultHeight Then
        Me.Height = lngDefaultHeight
    End If
    On Error GoTo 0

    bln5RowIsVisible = False
    If WanNeng Then
        lblBack.Move 50, tblReceipt.Height + 450, Me.ScaleWidth - 50 - 75 - 50, Me.ScaleHeight - (tblReceipt.Height + 510) - 50 - 75
    Else
        lblBack.Move 50, lblBack.top, Me.ScaleWidth - cmdButton(0).width - 75 - 50 - 75 - 50, Me.ScaleHeight - lblBack.top - 50 - 75
    End If
    
    lngUsabeHeight = lblBack.Height - 0 * Screen.TwipsPerPixelY   '900 - 50 - 75 'lblcaption's button to lblback's button
'    If WanNeng Then
'        lngUsabeHeight = lngUsabeHeight - tblReceipt.Height + 2 * Screen.TwipsPerPixelY
'    End If
     lngUsabeHeight = lngUsabeHeight - LblMemo(0).Height - 8 * Screen.TwipsPerPixelY
     lngUsabeHeight = lngUsabeHeight - 3 * Screen.TwipsPerPixelY
     lngUsabeHeight = lngUsabeHeight - (lblNote(0).Height + 2 * Screen.TwipsPerPixelY + intTotalRowHeight + 7 * Screen.TwipsPerPixelY)
     lngUsabeHeight = lngUsabeHeight - lblFieldCaption(0).Height - 2 * Screen.TwipsPerPixelY
     lngUsabeHeight = lngUsabeHeight + 2 * Screen.TwipsPerPixelY
    
    lngSpaceUnderCaption = lngUsabeHeight - Int(lngUsabeHeight \ GrdCol.RowHeightMin) * GrdCol.RowHeightMin
    If lngSpaceUnderCaption < 8 * Screen.TwipsPerPixelY Then
        lngUsabeHeight = lngUsabeHeight - GrdCol.RowHeightMin
        lngSpaceUnderCaption = lngSpaceUnderCaption + GrdCol.RowHeightMin
    End If
    If lngSpaceUnderCaption > 17 * Screen.TwipsPerPixelY Then
        lngSpaceUnderCaption = lngSpaceUnderCaption - 6 * Screen.TwipsPerPixelY
        lngSpaceUnderField = lngSpaceUnderField + 6 * Screen.TwipsPerPixelY
    End If
    
    If WanNeng Then
        lblCaption.Move lblBack.Left + (lblBack.width - lblCaption.width) \ 2, lblBack.top + 2 * Screen.TwipsPerPixelY
        lblFieldCaption(0).Caption = "字册号"
        lblFieldCaption(0).Move lblBack.Left + lblBack.width - lngWidthOfGrdRight - (3 + 6 + Field(0).bytFieldSize + Field(1).bytFieldSize) * Me.TextWidth("a") - 75, 900 + lngSpaceUnderCaption + tblReceipt.Height, Me.TextWidth("a") * 6
    Else
        lblCaption.Left = lblBack.Left + (lblBack.width - lblCaption.width) \ 2
        lblFieldCaption(0).Move lblBack.Left + 75, 900 + lngSpaceUnderCaption
    End If
    
    If WanNeng Then
        lblField(0).Move lblFieldCaption(0).Left + lblFieldCaption(0).width + 30, _
                         lblFieldCaption(0).top - 30, Field(0).bytFieldSize * Me.TextWidth("a"), _
                         lblFieldCaption(0).Height
            
        lblFieldCaption(1).Move lblField(0).Left + lblField(0).width - 15, lblField(0).top, (1) * Me.TextWidth("a"), lblField(0).Height
        lblField(1).Move lblField(0).Left + lblField(0).width + 3 * Me.TextWidth("a") - 15, lblField(0).top, (Field(1).bytFieldSize + 0) * Me.TextWidth("a"), lblField(0).Height
        lblField(4).Move lblField(0).Left + lblField(0).width + 0 * Me.TextWidth("a") - 15, lblField(0).top, 3 * Me.TextWidth("a") + 1 * Screen.TwipsPerPixelX, lblField(0).Height
    Else
        lblField(0).Move lblFieldCaption(0).Left + lblFieldCaption(0).width + 30, _
                         lblFieldCaption(0).top - 30, Field(0).bytFieldSize * Me.TextWidth("a"), _
                         lblFieldCaption(0).Height
            
        lblField(1).Move lblField(0).Left + lblField(0).width - 15, lblField(0).top, Field(1).bytFieldSize * Me.TextWidth("a"), lblField(0).Height
    
    End If
    lblFieldCaption(2).Move lblCaption.Left - ((StrLen(lblFieldCaption(2).Caption) + Field(2).bytFieldSize) * Me.TextWidth("a") + 30 - lblCaption.width) \ 2, _
                            lblFieldCaption(0).top, StrLen(lblFieldCaption(2).Caption) * Me.TextWidth("a")
     
    lblField(2).Move lblFieldCaption(2).Left + lblFieldCaption(2).width + 30, _
                     lblField(0).top, _
                     Field(2).bytFieldSize * Me.TextWidth("a"), _
                     lblFieldCaption(0).Height
    
    If WanNeng Then
        Dim lngTmp As Long
        lngTmp = lblField(2).top + (lblBack.top + lblBack.Height - lblField(2).top) \ 2 - 3 * Me.TextHeight("a")
        lblFU.Move lblBack.Left + lblBack.width - Me.TextWidth("a") * 3 - Screen.TwipsPerPixelX * 4, _
                      lngTmp + 3 * Me.TextHeight("a") + 3 * Screen.TwipsPerPixelY
        
        lblField(3).Move lblBack.Left + lblBack.width - Field(3).bytFieldSize * Me.TextWidth("a") - Screen.TwipsPerPixelX * 4, _
                         lngTmp + 2 * Me.TextHeight("a"), _
                         Field(3).bytFieldSize * Me.TextWidth("a"), _
                         Me.TextHeight("a") + 2 * Screen.TwipsPerPixelY
        lblFieldCaption(3).Caption = "附件"
        lblFieldCaption(3).Move lblBack.Left + lblBack.width - Me.TextWidth("a") * 3 - Screen.TwipsPerPixelX * 4, _
                                lngTmp, 2 * Me.TextWidth("a"), 2 * Me.TextHeight("a")
    Else
        lblFU.Move lblBack.Left + lblBack.width - 100 - lblFU.width, _
                      lblFieldCaption(0).top
        
        lblField(3).Move lblFU.Left - Field(3).bytFieldSize * Me.TextWidth("a") - Screen.TwipsPerPixelX * 2, _
                         lblField(0).top, _
                         Field(3).bytFieldSize * Me.TextWidth("a"), _
                         lblFieldCaption(0).Height
        lblFieldCaption(3).Move lblField(3).Left - (StrLen(lblFieldCaption(3).Caption) * Me.TextWidth("a")) - Screen.TwipsPerPixelX * 2, _
                                lblFieldCaption(0).top, StrLen(lblFieldCaption(3).Caption) * Me.TextWidth("a")
    End If
    lblField(0).Visible = True
    lblFieldCaption(0).Visible = True
    For i = 1 To lblField.Count - 1
        If i < 4 Then
            lblField(i).Visible = Field(i).blnVisible
        Else
            lblField(i).Visible = True
        End If
        If i = 1 Or i = 4 Then
            lblFieldCaption(i).Visible = False
        Else
            lblFieldCaption(i).Visible = Field(i).blnVisible
        End If
    Next i
    

    LblMemo(0).Move lblBack.Left + 100, lblBack.top + lblBack.Height - LblMemo(0).Height - 8 * Screen.TwipsPerPixelY
    
    Dim lngSpaceOnMemo As Long
    lngSpaceOnMemo = LblMemo(0).top - 3 * Screen.TwipsPerPixelY
    
    lblNote(0).Move 60 + 75, intTotalRowHeight + 5 * Screen.TwipsPerPixelY
    lblNote(1).Move lblNote(0).Left + lblNote(0).width + 75, lblNote(0).top, _
                    lblBack.Left + 75 + lblBack.width - lngWidthOfGrdRight - 2 * 50 - 75 - lblNote(1).Left - 100
    If lblNote(0).Visible = False Then
        lblNote(0).Visible = True
        lblNote(1).Visible = True
    End If
    
    lblTotal(0).Caption = "合计:"
    lblTotal(0).Alignment = 0
    lblTotal(1).Alignment = 0
    lblTotal(3).ZOrder 1

    bln5RowIsVisible = True
    Dim lngTop As Long
    If bln5RowIsVisible Then
        lngTop = lblField(2).top + lblField(2).Height + SpaceTwRow * 2
    Else
        lngTop = lblFieldCaption(2).top + SpaceTwRow
    End If
    GrdCol.Move lblBack.Left + 120, lngTop + 30 + lngSpaceUnderField, lblBack.width - lngWidthOfGrdRight - 2 * 50 - 130, _
                lngSpaceOnMemo - lblNote(0).Height - lngSpaceUnderField - intTotalRowHeight - (lngTop + 60) - 3 * Screen.TwipsPerPixelY
    'LblBack.Height - (grdCol.top - LblBack.top) - 1045
    BillPublic.LoadColWidthDefault Me, 2
    picFooter.Move lblBack.Left + Screen.TwipsPerPixelX, GrdCol.top + GrdCol.Height - Screen.TwipsPerPixelY, _
                    lblBack.width - 2 * Screen.TwipsPerPixelX, _
                    lblNote(0).Height + 2 * Screen.TwipsPerPixelY + intTotalRowHeight + 7 * Screen.TwipsPerPixelY
    grdColWidthAdjust

'    lblmemo(8).Tag = ""
'    lblmemo(0).Tag = 1
    
    Dim lngI(9) As Long
    Dim lngY As Long
    If LblMemo(8).Tag <> "" Then
        i = (GrdCol.width - 16 * Me.FontSize * 11)
    Else
        i = (GrdCol.width - 14 * Me.FontSize * 11)
    End If
    If i < 0 Then i = 50
    If LblMemo(0).Tag <> "" And LblMemo(8).Tag <> "" Then
        '主观及领款人都可见
        i = i \ 4
    ElseIf LblMemo(0).Tag <> "" Or LblMemo(8).Tag <> "" Then
        '主观及领款人有一可见
        i = i \ 3
    Else
        '主观及领款人都不可见
        i = i \ 2
    End If
    
    lngI(0) = LblMemo(0).Left
    lngI(1) = lngI(0) + LblMemo(0).width
    If LblMemo(0).Tag = "" Then
        lngI(2) = lngI(0)
        lngI(3) = lngI(2) + LblMemo(2).width
    Else
        lngI(2) = lngI(0) + i
        lngI(3) = lngI(2) + LblMemo(2).width
    End If
    lngI(4) = lngI(2) + i
    lngI(5) = lngI(4) + LblMemo(4).width
    lngI(6) = lngI(4) + i
    lngI(7) = lngI(6) + LblMemo(6).width
    lngI(8) = lngI(6) + i
    lngI(9) = lngI(8) + LblMemo(8).width
    lngY = LblMemo(0).top
    For i = 0 To LblMemo.Count - 1
        If i \ 2 * 2 = i Then
            LblMemo(i).ZOrder
            LblMemo(i).Move lngI(i), lngY
            LblMemo(i).AutoSize = False
            LblMemo(i).AutoSize = True
        Else
            LblMemo(i).Move lngI(i), lngY + Screen.TwipsPerPixelY, LblMemo(i).width, LblMemo(0).Height + 2 * Screen.TwipsPerPixelY
            LblMemo(i).AutoSize = True
        End If
        If i > 1 And i < 8 Then
            If LblMemo(i).Visible = False Then LblMemo(i).Visible = True
        ElseIf i <= 1 Then
            If LblMemo(0).Tag = "" Then
                LblMemo(i).Visible = False
            Else
                LblMemo(i).Visible = True
            End If
        ElseIf i = 9 Then
            LblMemo(i).Visible = False
        Else
            If LblMemo(8).Tag = "" Then
                LblMemo(i).Visible = False
            Else
                LblMemo(i).Visible = True
            End If
        End If
    Next i
    
    LblMemo(1).ZOrder IIf(Len(Trim(LblMemo(1).Caption)) > 0, 0, 1)
    LblMemo(3).ZOrder IIf(Len(Trim(LblMemo(3).Caption)) > 0, 0, 1)
    LblMemo(5).ZOrder IIf(Len(Trim(LblMemo(5).Caption)) > 0, 0, 1)
    LblMemo(7).ZOrder IIf(Len(Trim(LblMemo(7).Caption)) > 0, 0, 1)

'    lblNoteBack.Move grdCol.Left, lblTotal(0).top - 45, grdCol.Width, LblMemo(0).top - lblTotal(0).top + 30
    
'    grdColWidthAdjust
     
'     Me.Refresh
    My.blnRefresh = True

End Sub
Private Sub grdColWidthAdjust()
    Dim intI As Integer
    Dim lngSumWidthOfCols As Long
    Dim lngUsableWidth As Long
    Dim blnVscroll As Boolean
    Dim blnHscroll As Boolean
    Dim blnRefreshOld As Boolean
    Dim blnGrdOldDraw  As Boolean
    Dim lngColWidth(5) As Long
    blnRefreshOld = My.blnRefresh
'    My.blnRefresh = False
    If GrdCol.ColWidth(0) <> 0 Then GrdCol.ColWidth(0) = 0
    For intI = 6 To GrdCol.Cols - 1
        If GrdCol.ColWidth(intI) <> 0 Then GrdCol.ColWidth(intI) = 0
    Next intI
 '-----------------------
    lngSumWidthOfCols = 0
    ScrollBarExist blnHscroll, blnVscroll
    If blnVscroll Then
        lngUsableWidth = GrdCol.width - gclsEniv.VScrollWidth
    Else
        lngUsableWidth = GrdCol.width
    End If
    For intI = 1 To 5
        lngColWidth(intI) = GrdCol.ColWidth(intI)
        lngSumWidthOfCols = lngSumWidthOfCols + lngColWidth(intI)
    Next intI
    If lngSumWidthOfCols = 0 Then
        lngSumWidthOfCols = lngUsableWidth
    End If
    For intI = 1 To 5
        lngColWidth(intI) = ((lngColWidth(intI) * lngUsableWidth \ lngSumWidthOfCols) \ Screen.TwipsPerPixelX) * Screen.TwipsPerPixelX
    Next intI
    
    If lngColWidth(4) < 80 * Screen.TwipsPerPixelX Then
        lngColWidth(4) = 80 * Screen.TwipsPerPixelX
    ElseIf lngColWidth(4) > 120 * Screen.TwipsPerPixelX Then
        lngColWidth(4) = 120 * Screen.TwipsPerPixelX
    End If
    If lngColWidth(5) < 80 * Screen.TwipsPerPixelX Then
        lngColWidth(5) = 80 * Screen.TwipsPerPixelX
    ElseIf lngColWidth(5) > 120 * Screen.TwipsPerPixelX Then
        lngColWidth(5) = 120 * Screen.TwipsPerPixelX
    End If
    If ColProperty(3).blnUsable Then
        If lngColWidth(3) < 100 * Screen.TwipsPerPixelX Then
            lngColWidth(3) = 100 * Screen.TwipsPerPixelX
        ElseIf lngColWidth(3) > 160 * Screen.TwipsPerPixelX Then
            lngColWidth(3) = 160 * Screen.TwipsPerPixelX
        End If
    Else
        lngColWidth(3) = 0
    End If
    
    If lngColWidth(2) < 80 * Screen.TwipsPerPixelX Then
        lngColWidth(2) = 80 * Screen.TwipsPerPixelX
    End If
    If lngColWidth(1) < 80 * Screen.TwipsPerPixelX Then
        lngColWidth(1) = 80 * Screen.TwipsPerPixelX
    End If
    
    lngUsableWidth = lngUsableWidth - lngColWidth(3) - lngColWidth(4) - lngColWidth(5)
    lngSumWidthOfCols = lngColWidth(1) + lngColWidth(2)
    intI = 2
    lngColWidth(intI) = ((lngColWidth(intI) * lngUsableWidth \ lngSumWidthOfCols) \ Screen.TwipsPerPixelX) * Screen.TwipsPerPixelX
    lngColWidth(1) = lngUsableWidth - lngColWidth(2)
    For intI = 1 To 5
        GrdCol.ColWidth(intI) = lngColWidth(intI)
    Next intI
    TotalRowAdjust
     My.blnRefresh = blnRefreshOld
   
End Sub
Private Sub TotalRowAdjust(Optional ByVal blnFromGridDrag As Boolean = False)
 '合计行位置及宽度及当前可视性调整
    Dim i As Integer
    Dim lngWidth As Long
    Dim lngLeft As Long
    Dim lngTop As Long
    Dim lngHeight As Long
    
'    lngHeight = lngOldHeight - 5
'    lngHeight = lblTotal(0).Height
    lngHeight = intTotalRowHeight

    lngTop = lblNote(0).top - intTotalRowHeight - 2 * Screen.TwipsPerPixelY

    For i = 0 To GrdCol.Cols - 1
        If i > lblTotal.Count - 1 Then
            Exit For
        End If
        If i >= 4 Then
            If GrdCol.ColIsVisible(i) And GrdCol.ColWidth(i) > 0 Then
                ' lblTotal(i) is visible
                If GrdCol.ColPos(i) + GrdCol.ColWidth(i) > GrdCol.width Then
                    lngLeft = GrdCol.Left + GrdCol.ColPos(i) + 2 * IntSpace
                    lngWidth = IIf(GrdCol.width - GrdCol.ColPos(i) - intGrdBorderWidth - 4 * IntSpace > 0, _
                                        GrdCol.width - GrdCol.ColPos(i) - intGrdBorderWidth - 4 * IntSpace, 0)
                Else
                    lngLeft = GrdCol.Left + GrdCol.ColPos(i) + 2 * IntSpace
                    lngWidth = IIf(GrdCol.ColWidth(i) - 4 * IntSpace > 0, _
                                        GrdCol.ColWidth(i) - 4 * IntSpace, 0)
                End If
            End If
        ElseIf i = 0 Then
                lngLeft = GrdCol.Left + GrdCol.ColPos(i) + 2 * IntSpace
                lngWidth = 6 * lblTotal(0).FontSize * 10.05
        ElseIf i = 1 Or i = 3 Then

⌨️ 快捷键说明

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