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

📄 +

📁 财务分析 财财务分析务分析
💻
📖 第 1 页 / 共 5 页
字号:
  Dim CurrentRow As Integer
  Dim CurrentCol As Integer
  Let Bln_Add = False
  
  With WglrGrid
    '非数据行退出
    If .Row < .FixedRows Then
       Exit Sub
    End If
    
    Call xswbk
  
  End With
  Exit Sub


End Sub
Private Sub Ycwbk()                      '隐藏文本框,帮助按钮,列表组合框
 Valilock = True
   Ydtext.Visible = False
   YdCombo.Visible = False
   Ydcommand.Visible = False
End Sub
Private Sub YdCombo_KeyDown(KeyCode As Integer, Shift As Integer)        '列表框移动
  With WglrGrid
    Select Case KeyCode
      Case vbKeyEscape                'ESC 键放弃录入
           Valilock = True
            .SetFocus
            Call Ycwbk
           Valilock = False
      Case vbKeyReturn                '回 车 键 =13
           KeyCode = 0
           .SetFocus
           Call Lrsjhx
           Rowjsq = .Row
           Coljsq = .Col + 1
           If Coljsq > .Cols - 1 Then
              If Rowjsq < .Rows - 1 Then
                 Rowjsq = Rowjsq + 1
              End If
              Coljsq = Qslz
           End If
           Do While Rowjsq <= .Rows - 1
              If .ColHidden(Coljsq) Or (Not GridBoolean(Coljsq, 1)) Then
                 Coljsq = Coljsq + 1
                 If Coljsq > .Cols - 1 Then
                    Rowjsq = Rowjsq + 1
                    Coljsq = Qslz
                 End If
              Else
                 Exit Do
              End If
            Loop
            .Select Rowjsq, Coljsq
       Case vbKeyLeft                  '左 箭 头 =37
           If .Col - 1 = Qslz Then
              If .ColHidden(Qslz) Or (Not GridBoolean(Qslz, 1)) Then
                 GoTo jzzx
              End If
           End If
           If .Col > Qslz Then
              KeyCode = 0
              .SetFocus
              Call Lrsjhx
              Coljsq = .Col - 1
              Do While Coljsq > Qslz
                 If Coljsq - 1 = Qslz Then
                    If .ColHidden(Qslz) Or (Not GridBoolean(Qslz, 1)) Then
                       GoTo jzzx
                    End If
                 End If
                 If .ColHidden(Coljsq) Or (Not GridBoolean(Coljsq, 1)) Then
                    Coljsq = Coljsq - 1
                 Else
                      Exit Do
                 End If
               Loop
               .Select .Row, Coljsq
           End If

      Case vbKeyRight                 '右 箭 头 =39
            KeyCode = 0
            .SetFocus
            Call Lrsjhx
             Rowjsq = .Row
             Coljsq = .Col + 1
             If Coljsq > .Cols - 1 Then
                If Rowjsq < .Rows - 1 Then
                   Rowjsq = Rowjsq + 1
                End If
                Coljsq = Qslz
             End If
             Do While Rowjsq <= .Rows - 1
                If .ColHidden(Coljsq) Or (Not GridBoolean(Coljsq, 1)) Then
                   Coljsq = Coljsq + 1
                   If Coljsq > .Cols - 1 Then
                      Rowjsq = Rowjsq + 1
                      Coljsq = Qslz
                   End If
                Else
                   Exit Do
                End If
              Loop
              .Select Rowjsq, Coljsq
      Case Else
   End Select
   
jzzx:
   
 End With
End Sub
Private Sub YdCombo_LostFocus()
  With WglrGrid                                    '因为选中网格会先发生Rowcolchange事件置Valiock
    If Not Valilock Then                           '为TRUE
       Call Lrsjhx
       If Not Sjhzyxxpd(Dqlrwgh) Then
          Exit Sub
       End If
    End If
  End With
End Sub
Private Sub Ydcommand_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
   Call Lrzdbz
End Sub
Private Sub ydtext_KeyDown(KeyCode As Integer, Shift As Integer)
   Dim Rowjsq As Long, Coljsq As Long
  With WglrGrid
    Select Case KeyCode
      Case vbKeyF2
           Call Lrzdbz
      Case vbKeyEscape                'ESC 键放弃录入
           Valilock = True
            Call Ycwbk
           .SetFocus
      Case vbKeyReturn                '回 车 键 =13
           KeyCode = 0
           .SetFocus
           Call Lrsjhx
           Rowjsq = .Row
           Coljsq = .Col + 1
           If Coljsq > .Cols - 1 Then
              If Rowjsq < .Rows - 1 Then
                 Rowjsq = Rowjsq + 1
              End If
              Coljsq = Qslz
           End If
           Do While Rowjsq <= .Rows - 1
              If .ColHidden(Coljsq) Or (Not GridBoolean(Coljsq, 1)) Then
                 Coljsq = Coljsq + 1
                 If Coljsq > .Cols - 1 Then
                    Rowjsq = Rowjsq + 1
                    Coljsq = Qslz
                 End If
              Else
                 Exit Do
              End If
            Loop
            If Rowjsq <= .Rows - 1 Then
              .Select Rowjsq, Coljsq
            End If
      Case vbKeyUp                    '上 箭 头 =38
           KeyCode = 0
           .SetFocus
           Call Lrsjhx
           If .Row > .FixedRows Then
              .Row = .Row - 1
           End If
      Case vbKeyDown                  '下 箭 头 =40
           KeyCode = 0
           .SetFocus
           Call Lrsjhx
           If .Row < .Rows - 1 Then
              .Row = .Row + 1
           End If
       Case vbKeyLeft                  '左 箭 头 =37
           If .Col - 1 = Qslz Then
              If .ColHidden(Qslz) Or (Not GridBoolean(Qslz, 1)) Then
                 GoTo jzzx
              End If
           End If
           If Ydtext.SelStart = 0 And .Col > Qslz Then
              KeyCode = 0
              .SetFocus
              Call Lrsjhx
              Coljsq = .Col - 1
              Do While Coljsq > Qslz
                 If Coljsq - 1 = Qslz Then
                    If .ColHidden(Qslz) Or (Not GridBoolean(Qslz, 1)) Then
                       GoTo jzzx
                    End If
                 End If
                 If .ColHidden(Coljsq) Or (Not GridBoolean(Coljsq, 1)) Then
                    Coljsq = Coljsq - 1
                 Else
                      Exit Do
                 End If
               Loop
               .Select .Row, Coljsq
           End If
jzzx:
           
           
      Case vbKeyRight                 '右 箭 头 =39
            wblong = Len(Ydtext.Text)
            If (Ydtext.SelStart = wblong Or Ydtext.SelLength = wblong) Then
               KeyCode = 0
               .SetFocus
               Call Lrsjhx
                Rowjsq = .Row
                Coljsq = .Col + 1
                If Coljsq > .Cols - 1 Then
                   If Rowjsq < .Rows - 1 Then
                      Rowjsq = Rowjsq + 1
                   End If
                   Coljsq = Qslz
                End If
                Do While Rowjsq <= .Rows - 1
                   If .ColHidden(Coljsq) Or (Not GridBoolean(Coljsq, 1)) Then
                      Coljsq = Coljsq + 1
                      If Coljsq > .Cols - 1 Then
                         Rowjsq = Rowjsq + 1
                         Coljsq = Qslz
                      End If
                   Else
                      Exit Do
                   End If
                 Loop
                 .Select Rowjsq, Coljsq
               End If
      Case Else
   End Select
 End With
End Sub
Private Sub ydtext_KeyPress(KeyAscii As Integer)         '录入字符事中控制
  Call InputFieldLimit(Ydtext, GridInt(WglrGrid.Col, 1), KeyAscii)
  If KeyAscii <> 0 Then
     Call Xyxhbz(Dqlrwgh)
  End If
End Sub
Private Sub ydtext_Change()                              '录入事中变化处理

  '防止程序改变但不进行处理

  If Wbkbhlock Then
     Exit Sub
  End If

  With WglrGrid

    '限制字段录入长度
     Wbkbhlock = True
       Select Case GridInt(.Col, 1)
          Case 8
            Call Sjgskz(Ydtext, Xtjezws - Xtjexsws - 1, Xtjexsws)
          Case 9
            Call Sjgskz(Ydtext, Xtslzws - Xtslxsws - 1, Xtslxsws)
          Case 10
            Call Sjgskz(Ydtext, Xtdjzws - Xtdjxsws - 1, Xtdjxsws)
          Case Else
             If GridInt(.Col, 3) <> 0 Or GridInt(.Col, 4) <> 0 Then
                Call Sjgskz(Ydtext, GridInt(.Col, 3), GridInt(.Col, 4))
             End If
       End Select
      Wbkbhlock = False
  End With
End Sub
Private Sub ydtext_LostFocus()            '如果由于选中网格之外的控件而发生有效性判断(选中网格会先发生Rowcolchange事件置Valiock为TRUE)
  With WglrGrid
    If Not Valilock Then
       Call Lrsjhx
       If Not sjzdyxxpd(Dqlrwgh, Dqlrwgl) Then
          Exit Sub
       End If
       If Not Sjhzyxxpd(Dqlrwgh) Then
          Exit Sub
       End If
    End If
  End With
End Sub
Private Sub xswbk()                       '在当前选中单元显示文本框,列表框,帮助按钮(通用)
  Dim Wbkpy As Integer, Wbkpy1 As Integer '文本框偏移量
  
  '如果单据操作状态为浏览状态则不能显示录入载体
   If Trim(Lab_OperStatus.Caption) = "1" Then
      Exit Sub
   End If
     
  '显示文本框前返回有效行列(解决滚动条问题)
  Call Xldqh
  Call Xldql
  
  '隐藏文本框,帮助按钮,列表组合框
  Call Ycwbk
  
  With WglrGrid
    Dqlrwgh = .Row
    Dqlrwgl = .Col
    If Not GridBoolean(.Col, 1) Or .Row < .FixedRows Then
       Exit Sub
    End If
     
    Wbkpy = 30
    Wbkpy1 = 15
    
    If GridBoolean(.Col, 3) Then
       YdCombo.Left = .CellLeft + .Left + Wbkpy
       YdCombo.Top = .CellTop + .Top + Wbkpy
       YdCombo.Width = .CellWidth - Wbkpy1
       Call Wbkcl
       YdCombo.Visible = True
       YdCombo.SetFocus
       Ydcommand.Visible = False
       Ydtext.Visible = False
    Else
      If GridBoolean(.Col, 2) Then
        Ydcommand.Left = .Left + .CellLeft + .CellWidth - Ydcommand.Width + Wbkpy
        Ydcommand.Top = .Top + .CellTop + .CellHeight - Ydcommand.Height + Wbkpy
        Ydcommand.Visible = True
      Else
        Ydcommand.Visible = False
      End If
     
      Ydtext.Left = .CellLeft + .Left + Wbkpy
      Ydtext.Top = .CellTop + .Top + Wbkpy
      If Ydcommand.Visible Then
        If Sfblbzkd Then
            Ydtext.Width = .CellWidth - Ydcommand.Width
        Else
            Ydtext.Width = .CellWidth - Wbkpy1
        End If
      Else
         Ydtext.Width = .CellWidth - Wbkpy1
      End If
      Ydtext.Height = .CellHeight - Wbkpy1
      
      If GridInt(.Col, 2) <> 0 Then
         Ydtext.MaxLength = GridInt(.Col, 2)
      Else
         Ydtext.MaxLength = 3000
      End If
      
      Call Wbkcl
      
      Ydtext.Visible = True
      Ydtext.SetFocus
    End If
    Dqtoprow = .TopRow
    Dqleftcol = .LeftCol
    
    '重置锁值
    Valilock = False
    Wbkbhlock = False
 End With
End Sub
Private Sub Cxxswbk()                                                  'Formresize中重新显示文本框,列表框,帮助按钮(通用)
                   
  Dim Wbkpy As Integer, Wbkpy1 As Integer
  Wbkpy = 30
  Wbkpy1 = 15
  With WglrGrid
     If YdCombo.Visible Then
       YdCombo.Left = .CellLeft + .Left + Wbkpy
       YdCombo.Top = .CellTop + .Top + Wbkpy
       YdCombo.Width = .CellWidth - Wbkpy1
     End If

⌨️ 快捷键说明

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