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

📄 设备档案_设备故障显示.frm

📁 新世纪ERP设备管理源代码
💻 FRM
📖 第 1 页 / 共 3 页
字号:
Private Sub WglrGrid_Scroll()                                       '限制用户在录入过程中滚动鼠标

    If Gdtlock Then
        Exit Sub
    End If
 
    With WglrGrid
        If Ydtext.Visible Or YdCombo.Visible Then
            Gdtlock = True
            .TopRow = Dqtoprow
            .LeftCol = Dqleftcol
            Gdtlock = False
            Exit Sub
        End If
    End With
    
End Sub

Private Sub WglrGrid_LeaveCell()                                    '离开单元格
  
    If Changelock Then
        Exit Sub
    End If

    '记录刚刚离开网格单元的行列值
    Dqlkwgh = WglrGrid.Row
    Dqlkwgl = WglrGrid.Col

    '判断是否需要录入数据回写
    If Not (Ydtext.Visible Or YdCombo.Visible) Then
        Exit Sub
    End If
    
    Call Lrsjhx
    
End Sub

Private Sub WglrGrid_RowColChange()                                '网格录入行列发生变化时,进行有效性判断
   
   
End Sub

Private Sub WglrGrid_DblClick()          '鼠标双击网格显示文本框

    With WglrGrid
        Call xswbk
    End With
  
End Sub

Private Sub Ycwbk()                      '隐藏文本框,帮助按钮,列表组合框
 
    Valilock = True
    Ydtext.Visible = False
    YdCombo.Visible = False
    Ydcommand.Visible = False
    
End Sub


Private Sub YdCombo_LostFocus()
  
    With WglrGrid                                    '因为选中网格会先发生Rowcolchange事件置Valiock
        If Not Valilock Then                           '为TRUE
            Call Lrsjhx
        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_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, 11   '金额型
                Call Sjgskz(Ydtext, Xtjezws - Xtjexsws - 1, Xtjexsws)
            Case 9, 12   '数量型
                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
        End If
    End With
  
End Sub

Private Sub xswbk()                       '在当前选中单元显示文本框,列表框,帮助按钮(通用)
    
    Dim Wbkpy As Integer, Wbkpy1 As Integer '文本框偏移量
  
    '当某种条件成立时禁止文本框激活使单据处于录入状态
    If Not Fun_AllowInput 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 Function Fun_AllowInput() As Boolean                           '当某种条件成立时禁止文本框激活使单据处于录入状态
   
    '如果单据操作状态为浏览状态则不能显示录入载体(通用)
    If Trim(Lab_OperStatus.Caption) = "1" Then
        Exit Function
    End If
   
    '[>>
    
        '此处可以填写禁止文本框激活使单据处于录入状态的理由
   
    '<<]
   
    Fun_AllowInput = True
    
End Function

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
        If Ydcommand.Visible Then
            Ydcommand.Left = .Left + .CellLeft + .CellWidth - Ydcommand.Width + Wbkpy
            Ydcommand.Top = .Top + .CellTop + .CellHeight - Ydcommand.Height + Wbkpy
        End If
        If Ydtext.Visible Then
            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.Left = .CellLeft + .Left + Wbkpy
            Ydtext.Top = .CellTop + .Top + Wbkpy
            Ydtext.Height = .CellHeight - Wbkpy1
        End If
   End With

End Sub

Private Sub Lrsjhx()                                                   '文本框录入数据回写
  
    With WglrGrid
        If YdCombo.Visible Then
            .Text = Trim(YdCombo.Text)
        End If
        If Ydtext.Visible Then
            .Text = Trim(Ydtext.Text)
        End If
   
        '(如果字段录入内容发生变化,则打开有效性判断锁)
        If Zdlrqnr <> Trim(.Text) Then
            Yxxpdlock = False
            Hyxxpdlock = False
        End If
   
        '如果字段录入内容不为空则写数据行有效性标志
   
        If Len(Trim(.Text)) <> 0 Then
'            Call Xyxhbz(.Row)
        End If
   
        '隐藏文本框,帮助按钮,列表组合框
        Call Ycwbk
    End With
    
End Sub

Private Sub WglrGrid_KeyDown(KeyCode As Integer, Shift As Integer)    '网格录入增行,删行快捷键
  
    '如果单据操作状态为浏览状态则不能显示录入载体
    If Trim(Lab_OperStatus.Caption) = "1" Then
        Exit Sub
    End If

    Select Case KeyCode
        Case vbKeyF2                   '按F2键参照
            Call xswbk
        Call Lrzdbz
            Case vbKeyDelete               '删行
'        Call Scdqfl
'            Case vbKeyInsert               '增行
'        Call zjlrfl
    End Select
    
End Sub


Private Sub Qkwlzd(sjh As Long, Sjl As Long)                            '清空为零字段

    If Not GridBoolean(Sjl, 5) Then
        Exit Sub
    End If
    
    With WglrGrid
        If Val(Trim(.TextMatrix(sjh, Sjl))) = 0 Then
            .TextMatrix(sjh, Sjl) = ""
        End If
    End With
  
End Sub


Private Sub WglrGrid_BeforeMoveColumn(ByVal Col As Long, Position As Long)           '网格列发生移动时自动交换网格索引信息
    
    Call FnBln_RefreshArray(Col, Position, GridStr(), GridInf())

End Sub

Private Sub GsToolbar_ButtonClick(ByVal Button As MSComctlLib.Button)   '表格格式设置(通用)
    
    Select Case Button.Key
        Case "bcgs"                                       '保存表格格式
            Call Bcwggs(WglrGrid, GridCode, GridStr())
        Case "hfmrgs"                                     '恢复默认格式
            Call Hfmrgs(WglrGrid, GridCode, GridStr())
    End Select
    
End Sub

Private Sub bbyl(bbylte As Boolean)                    '报表打印预览
  
    Dim Bbzbt$, Bbxbt() As String, bbxbtzzxs() As Integer, Bbxbtgs As Integer
    Dim Bbbwh() As String, Bbbwhzzxs() As Integer, Bbbwhgs As Integer
    Bbxbtgs = 3                                          '报 表 小 标 题 行 数
    Bbbwhgs = 0                                          '报 表 表 尾 行 数
    ReDim Bbxbt(1 To Bbxbtgs)
    ReDim bbxbtzzxs(1 To Bbxbtgs)
    
    If Bbbwhgs <> 0 Then
        ReDim Bbbwh(1 To Bbbwhgs)
        ReDim Bbbwhzzxs(1 To Bbbwhgs)
    End If
    
    Bbzbt = ReportTitle
    
  
    Call Scyxsjb(WglrGrid)                               '生成报表数据
    Call Scdybb(Dyymctbl, Bbzbt, Bbxbt(), bbxbtzzxs(), Bbxbtgs, Bbbwh(), Bbbwhzzxs(), Bbbwhgs, bbylte)
  
    If Not bbylte Then
        Unload DY_Tybbyldy
    End If
    
End Sub

⌨️ 快捷键说明

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