📄 设备档案_设备检修记录显示.frm
字号:
'解 锁
Valilock = False
Changelock = False
End Sub
Private Sub Form_KeyUp(KeyCode As Integer, Shift As Integer) '支持热键操作
If Shift = 2 Then
Select Case UCase(Chr(KeyCode))
Case "P" 'Ctrl+P 打印
If Tlb_Action.Buttons("dy").Enabled Then
Call bbyl(False)
End If
End Select
End If
End Sub
Private Sub Wbkcl() '文本框录入之前处理(根据实际情况)
Dim xswbrr As String
With WglrGrid
Zdlrqnr = Trim(.Text)
xswbrr = Trim(.Text)
If GridBoolean(.Col, 3) Then '列表框录入
'填充列表框程序
Call FillCombo(YdCombo, GridStr(.Col, 5), xswbrr, 0)
Else
Wbkbhlock = True
'====以下为用户自定义
Ydtext.Text = xswbrr
'====以上为用户自定义
Wbkbhlock = False
Ydtext.SelStart = Len(Ydtext.Text)
End If
End With
End Sub
'===================以 下 程 序 为 通 用 部 分 ,一 般 不 需 更 改(程序动作部分)======================='
Private Sub Lrzdbz() '录入字段帮助
If Not Ydcommand.Visible Then
Exit Sub
End If
With WglrGrid
Valilock = True
'处理通用部分
Changelock = True '调入另外窗体必须加锁
Call Drbmhelp(GridInt(.Col, 6), GridStr(.Col, 3), Trim(Ydtext.Text))
Changelock = False
If Len(Xtfhcs) <> 0 Then
If GridInt(.Col, 7) = 0 Then
Ydtext.Text = Xtfhcs
Else
Ydtext.Text = Xtfhcsfz
End If
End If
Valilock = False
If Ydtext.Visible Then
Ydtext.SetFocus
End If
End With
End Sub
Private Sub Form_Resize() '窗体大小发生变化时,重新显示文本框
Call Cxxswbk
End Sub
Private Function Fun_Drfrmyxxpd() As Boolean '调入其它窗体或功能产生的有效性判断(包括数据回写)
Fun_Drfrmyxxpd = True
With WglrGrid
'如果当前网格处于编辑状态,则先进行数据回写再进行有效性判断
End With
End Function
Private Sub WglrGrid_EnterCell() '显示当前数据行相关信息
With WglrGrid
If .Row >= .FixedRows Then
'[>>
'此处可以填写显示与此网格行相关信息
'<<]
End If
End With
End Sub
Private Sub WglrGrid_GotFocus() '网格得到焦点
'网格得到焦点,如果当前选择行为非数据行
'则调整当前焦点至有效数据行
With WglrGrid
If .Row < .FixedRows And .Rows > .FixedRows Then
Changelock = True
.Select .FixedRows, .Col
Changelock = False
End If
If .Col < Qslz Then
Changelock = True
.Select .Row, Qslz
Changelock = False
End If
End With
End Sub
Private Sub WglrGrid_LostFocus() '录入网格失去焦点
'用以屏蔽调用其它窗体时发生网格失去焦点事件
If Changelock Then
Exit Sub
End If
'引发网格RowcolChange事件
With WglrGrid
If Not (Ydtext.Visible Or YdCombo.Visible) Then
.Select 0, 0
End If
End With
End Sub
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 Ycwbk() '隐藏文本框,帮助按钮,列表组合框
Valilock = True
Ydtext.Visible = False
YdCombo.Visible = False
Ydcommand.Visible = False
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
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 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 + -