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

📄 frmtransvoucher.frm

📁 金算盘软件代码
💻 FRM
📖 第 1 页 / 共 5 页
字号:
        If lblmemo(i).Visible = False Then lblmemo(i).Visible = True
    Next i
    
    If Not ctrInput Is Nothing Then
        SaveInput2Form
        If UCase(ctrInput.Name) = "SPININPUT1" Then
        Else
            ctrInput.Move -5000, -5000
        End If
    End If
    txtInput.Visible = False
    
    GrdAndLabelInitial
    Me.Refresh
    My.blnRefresh = True
    SetAFocus
Debug.Print "RESIZE" & time
End Sub

Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Integer)
    On Error Resume Next
    If gclsSys Is Nothing Or clsBase Is Nothing Or clsRed Is Nothing Then
        Unload MsgForm
        Unload Me
        Exit Sub
    End If
    If blnNotRaiseEvent Then Exit Sub
    
    If lngFormHwnd(25) > 0 Then
        If FrmVoucher.blnPreViewVoucher Then
            Unload FrmVoucher
            If lngFormHwnd(25) > 0 Then
                Cancel = 1
                Exit Sub
            End If
        End If
    End If
'-------------------------------
    SaveInput2Form
    My.bytRegion = FcmdButton
    If Not ctrInput Is Nothing Then
        ctrInput.Move -5000
    End If
    If Not ctrPicInput Is Nothing Then
        ctrPicInput.Move -5000
    End If
    txtInput.Move -5000
    
    If Not ChangeSaveNote Then
        gblnCancel = True
        Cancel = True
        Exit Sub
    End If
    gclsSys.MainControls.Remove Me
    gclsSys.SendMessage Me.hwnd, msgTrans
    My.lngNowID = 0
    Erase strColRow
    Erase Field
    Erase PicLbl
    Erase ColProperty
    Set ColBill = Nothing
    Set ctrInput = Nothing
    Set clsBase = Nothing
    Set clsRed = Nothing
    Set ctrPicInput = Nothing
    Set mclsSubClass = Nothing
    Set mclsHook = Nothing
    Set KeyPressHook = Nothing
    Set mclsMainControl = Nothing
    Unload Me
End Sub

Private Sub grdEnterCell()
    
    Dim blnMark As AccountblnOther
    
    If Not My.blnCtrlBinding Then
        Exit Sub
    End If

    If Not My.blnMayChange Then
'        ShowMsg Me.hwnd, "该用户没有修改单据的权限", MB_SYSTEMMODAL + MB_ICONEXCLAMATION, "警告信息"
        SetAFocus
        Exit Sub    '权限控制
    End If
    blnMark = blnOther(C2lng(grdCol.TextMatrix(grdCol.Row, 16)))
'    If blnMark.blnIsAllCurrency Or blnMark.blnIsMultiCurrency Then
'        ColProperty(5).blnReadOnly = False
'    Else
'        ColProperty(5).blnReadOnly = True
'    End If
    If (ColProperty(5).blnReadOnly = True Or C2lng(grdCol.TextMatrix(grdCol.Row, 16)) < 1) And grdCol.col = 5 Then
        If Trim(grdCol.TextMatrix(grdCol.Row, 5)) = "" And (Trim(grdCol.TextMatrix(grdCol.Row, 2)) = "" Or C2lng(grdCol.TextMatrix(grdCol.Row, 16)) < 1) Then
            ShowMsg Me.hwnd, "请先选择一科目后再进行币种的设置", MB_SYSTEMMODAL + MB_ICONEXCLAMATION, "提示信息"
            grdCol.Row = My.lngOldRow
            grdCol.col = 2
'            grdEnterCell
        Else
            grdCol.Row = My.lngOldRow
            grdCol.col = My.lngOldCol
        End If
        grdEnterCell
        Exit Sub
    End If
    
    If SaveInput2Form() = False Then
        If refInput(0).Visible And refInput(0).Enabled And refInput(0).Left > LblBack.Left Then
            refInput(0).SetFocus
        ElseIf refInput(1).Visible And refInput(1).Enabled And refInput(1).Left > LblBack.Left Then
            refInput(1).SetFocus
        ElseIf refInput(0).Visible And refInput(0).Enabled Then
            refInput(0).SetFocus
        End If
        Exit Sub
    End If
    
    If grdCol.Row <> My.lngOldRow Then
        If My.lngOldRow > 0 And My.lngOldRow < grdCol.Rows - 1 Then
            If RowIsRight(My.lngOldRow) = False Then
                grdCol.Row = My.lngOldRow
                grdCol.col = My.lngOldCol
            End If
        End If
    
        If grdCol.Rows - 1 <> grdCol.Row Then
            If blnNotNullRow(grdCol.Rows - 1) = False Then
                grdCol.TextMatrix(grdCol.Rows - 1, 1) = ""
            End If
        End If
    
    End If
    If grdCol.Row = 0 Or grdCol.col = 0 Then Exit Sub
    
    blnNotScroll = True
        If (grdCol.width <= grdCol.ColPos(grdCol.col) + grdCol.ColWidth(grdCol.col)) Or (grdCol.ColPos(grdCol.col) < 0) Then
            grdCol.LeftCol = grdCol.col
        End If
    blnNotScroll = False
    
    If Not ctrInput Is Nothing Then
        Set ctrInput.Container = Me
        If UCase(ctrInput.Name) = "SPININPUT1" Then
        Else
          ctrInput.Move -5000, -5000
        End If
    End If
    If Not ctrPicInput Is Nothing Then
        ctrPicInput.Move -5000, -5000
        Set ctrPicInput = Nothing
    End If
    txtInput.Move -5000
'    txtInput.Visible = False

    If grdCol.col = My.lngOldCol And grdCol.Row = My.lngOldRow Then
    Else
        If Not DataValid_LostFocus() Then
            Exit Sub
        End If
    End If
    If grdCol.col > 8 Or grdCol.col < 1 Then Exit Sub

    My.lngOldCol = grdCol.col
    My.lngOldRow = grdCol.Row
        
 '设当前表体PIC输入标志为假,为表体网格输入状态
    
        Select Case grdCol.col
            Case 2       '科目
                '根据科目ID构造原币及本币金额输入项目
                'grdcol的第五列存放当前行的科目ID
                imgExproler.Move -5000
                txtInput.Move -5000
                ModifyPicInputItem grdCol.col, _
                    C2lng(grdCol.TextMatrix(grdCol.Row, ColProperty(2).bytGrdIDCol))
                                
                Set ctrInput = picInput
                Set ctrInput.Container = Me
                GrdInputButtonLocal grdCol.Row, grdCol.col, True
                ' 标记输入位置
                My.bytRegion = FPicture
                My.bytIndex = 0
                ctrInput.ZOrder
                '第0行取得焦点
                picLblInput_Getfocus 0
                Exit Sub
            Case 3, 4     '方向、性质
                imgExproler.Move -5000
                txtInput.Move -5000
                refInput(0).SeekCol = "1,2"
                refInput(0).Appearance = 0
                refInput(0).BorderStyle = 0
                refInput(0).width = grdCol.ColWidth(grdCol.col)
                refInput(0).AutoPop = True
                Set ctrInput = refInput(0)
                Set ctrInput.Container = Me
                If grdCol.col = 3 Then
                    cboAutoAdd ctrInput, 2
                Else
                    cboAutoAdd ctrInput, 3
                End If
                My.bytRegion = FGrid
                My.bytIndex = grdCol.col
                ctrInput.Text = grdCol.TextMatrix(grdCol.Row, grdCol.col)
                strOldText = grdCol.Text
                GrdInputButtonLocal grdCol.Row, grdCol.col
                ctrInput.ZOrder
                ctrInput.TabIndex = 0
                If ctrInput.Visible And ctrInput.Enabled Then
                    ctrInput.SetFocus
                End If
            Case 6, 8
                ImgExpreloerPosition
                Set ctrInput = imgExproler
                Set ctrInput.Container = Me
                My.bytRegion = FGrid
                My.bytIndex = grdCol.col
                ctrInput.ZOrder 0
                
                blnMark = BillPublic.blnOther(C2lng(grdCol.TextMatrix(grdCol.Row, 16)))
                If grdCol.col = 6 And grdCol.TextMatrix(grdCol.Row, 9) <> "1" Then
                  If C2Dbl(grdCol.TextMatrix(grdCol.Row, 9)) <> 0 And C2lng(grdCol.TextMatrix(grdCol.Row, 17)) <> gclsBase.NaturalCurId Then
                    '(blnMark.blnIsAllCurrency Or blnMark.blnIsMultiCurrency) And C2lng(grdCol.TextMatrix(grdCol.Row, 17)) <> gclsBase.NaturalCurId And
                    imgExproler.Enabled = True
                  Else
                    imgExproler.Enabled = False
                    txtInput.Visible = False
                  End If
                ElseIf grdCol.col = 8 And grdCol.TextMatrix(grdCol.Row, 9) <> "1" Then
                    'blnMark.blnIsQuantity And
                    If C2Dbl(grdCol.TextMatrix(grdCol.Row, 9)) <> 0 Then
                        imgExproler.Enabled = True
                    Else
                        imgExproler.Enabled = False
                    End If
                Else
                    imgExproler.Enabled = False
                    txtInput.Visible = False
                End If
                If imgExproler.Enabled Then
                    txtInput.Visible = True
                    txtInput.Enabled = True
                    txtInput.Text = grdCol.TextMatrix(grdCol.Row, grdCol.col)
                    txtInput.SetFocus
                    txtInput.ParenthWnd = grdCol.hwnd
                End If
            Case 7
                ImgExpreloerPosition
                Set ctrInput = imgExproler
                Set ctrInput.Container = Me
                My.bytRegion = FGrid
                My.bytIndex = grdCol.col
                ctrInput.ZOrder 0
                imgExproler.Enabled = True
                If C2Dbl(grdCol.TextMatrix(grdCol.Row, 9)) = 0 Then
                    imgExproler.Enabled = False
                    txtInput.Visible = False
                End If
                If grdCol.TextMatrix(grdCol.Row, 9) = "1" Or C2lng(grdCol.TextMatrix(grdCol.Row, 16)) < 1 Then
                    imgExproler.Enabled = False
                    txtInput.Visible = False
                End If
                If imgExproler.Enabled Then
                    txtInput.Visible = True
                    txtInput.Enabled = True
                    txtInput.Text = grdCol.TextMatrix(grdCol.Row, grdCol.col)
                    txtInput.SetFocus
                    txtInput.ParenthWnd = grdCol.hwnd
                End If
            Case Else
                imgExproler.Move -5000
                txtInput.Move -5000
                If grdCol.col > grdCol.Cols - 1 Then
                    Exit Sub
                End If
                Select Case ColProperty(grdCol.col).lngCtrType
                    Case TRefer
                        refInput(0).SeekCol = "1,2,3"
                        refInput(0).width = grdCol.ColWidth(grdCol.col)
                        If grdCol.col = 5 Then
                            refInput(0).AutoPop = True
                            refInput(0).CodeSort = True
                            refInput(0).SQL = clsRed.RecordSQL(xCurrencys, 0) ' C2lng(GrdCol.TextMatrix(GrdCol.Row, 16)))
                            Set refInput(0).Recordset = clsRed.RecordCon(xCurrencys, 0) ' C2lng(GrdCol.TextMatrix(GrdCol.Row, 16)))
                        Else
                            If grdCol.col = 1 Then
                                refInput(0).AutoPop = False
                                refInput(0).CodeSort = True
                            Else
                                refInput(0).AutoPop = True
                                refInput(0).CodeSort = False
                            End If
                            refInput(0).SQL = clsRed.RecordSQL( _
                                    ColProperty(grdCol.col).bytReferSort)
                            Set refInput(0).Recordset = clsRed.RecordCon( _
                                    ColProperty(grdCol.col).bytReferSort)
                        End If
                        If ColProperty(grdCol.col).blnAdded Then
                            refInput(0).AddRefer "<新增>"
                            refInput(0).AddRefer "<修改>"
                            refInput(0).AddRefer "<删除>"
                        End If
                        refInput(0).Appearance = 0
                        refInput(0).BorderStyle = 0
                        refInput(0).Tag = MsgNO(ColProperty(grdCol.col).bytReferSort)
                        Set ctrInput = refInput(0)
                        ctrInput.SeekId C2lng(grdCol.TextMatrix(grdCol.Row, ColProperty(grdCol.col).bytGrdIDCol))
                    Case Else
                        txtInput.Appearance = 0
                        txtInput.BorderStyle = 0
                        Set ctrInput = txtInput
                End Select
                Set ctrInput.Container = Me
                Grid2Button grdCol.Row, grdCol.col
                GrdInputButtonLocal grdCol.Row, grdCol.col
                ctrInput.ZOrder 0
                ctrInput.TabIndex = 0
                '取得焦点
                If ctrInput.Visible And ctrInput.Enabled Then
                    ctrInput.ParenthWnd = grdCol.hwnd
                    ctrInput.SelStart = 0
                    ctrInput.SetFocus
                End If
                ' 标记输入位置
                lngOldID = C2lng(grdCol.TextMatrix(grdCol.Row, ColProperty(grdCol.col).bytGrdIDCol))
                strOldText = grdCol.Text
                My.bytRegion = FGrid
                My.bytIndex = grdCol.col
        End Select
    
End Sub

Private Sub ModifyPicInputItem(ByVal intColNo As Integer, Optional ByVal lngKeMuID As Long = 0)
'构造PIC录入框,并对有关内容赋值
'intColNo = 2 科目输入
'           5  原币输入
'lngKeMuID 决定有关输入项目
    Dim intI As Integer
    Dim blnDefault As Boolean
    Dim srCode As String
    Dim srName As String
    Dim blnMark As AccountblnOther
    
    blnDefault = False
    On Error Resume Next
    If Not picInput Is Nothing Then
        picInput.ZOrder 1
    End If
    
    For intI = lblTitle.Count - 1 To 1 Step -1
        Unload lblTitle(intI)
        Unload lblInput(intI)
        If Not imgPicDown(intI) Is Nothing Then
            Unload imgPicDown(intI)
        End If
    Next intI
     blnMark = BillPublic.blnOther(lngKeMuID)
        Select Case intColNo
            Case 2  '科目输入
                intI = 1
                NewInputRow 0, "科目", 2, 4, 18

⌨️ 快捷键说明

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