这两天遇到一个怪现象,一直没有办法解决:窗体中放置了1个主表,下方通过 Tabcontrol 设置了3个不同的表的副本,全部为只读属性,并依主表名更改了副本表名称 ,方便程序中辨识处理.
操作中,发现后面2个表(工单状态数据一览,实际工序生产明细表)通过主表的currentchanged使用正常,2个表均实现了同步变化,但第一个副表(生产问题跟踪)却没有反应, 当我点击"生产问题跟踪"页头后,整个项目文件接下来全部没有了反应, 我必须手工在命令窗口中运行 SystemReady=true后才能正常
我试着在主表CurrentChanged事件中增加了 下方红色区域的集合判断,仍没有效果
'变更schedule,将工序信息写入下方表中
'MessageBox.Show(1)
SystemReady = False
Try
If Not DataTables.Contains("WorkOrderStatus") Then
DataTables.Load("WorkOrderStatus")
DataTables("WorkOrderStatus").Load
End If
If Not DataTables.Contains("Production_List") Then
DataTables.Load("Production_List")
DataTables("Production_List").Load
End If
'Forms("CellKanban").Show
Dim wo As String
Dim dr As DataRow = e.Table.Current.DataRow
wo = dr("WO")
If wo = "" Then GoTo 1
Dim drs As List(Of DataRow) = DataTables("AddtionalWOData").Select("WO = '" & wo & "'")
If drs.Count > 0 Then
Tables("CellKanban_AddtionalWOData").Filter = "[WO]='" & wo & "'"
Tables("CellKanban_AddtionalWOData").Sort = "OP"
End if
Tables("CellKanban_WOStatus").Filter = "[WO]='" & wo & "'" '工单数据 Work Order Status
Tables("CellKanban_WOStatus").Sort = "OP"
Tables("CellKanban_ProductionList").Filter = "[WO]='" & wo & "'" '工单数据 Production_List
Tables("CellKanban_ProductionList").Sort = "OP,ScanIn_Time"
Dim PN As String = e.Table.Current("PartNumber")
Dim Pbx As WinForm.PictureBox = e.Form.Controls("PictureBox1")
Dim fpf As String
Dim fp As String = "P:\General documents\Setup\Pic\" '\\freenas01chi\Production\General documents\Setup\Pic\
fpf = fp & PN & ".jpg"
If FileSys.FileExists(fpf) = False Then
fp = "T:\ME\ME Documentation\Picture\" '\\domain.pragon\china\ME\ME Documentation\Picture\" & PN & ".jpg"
fpf = fp & PN & ".jpg"
If FileSys.FileExists(fpf) = False Then
fpf = "P:\General documents\Setup\Pic\Error.jpg"
End If
End If
pbx.ImageFile = fpf
pbx.SizeMode = ImageSizeMode.Zoom
Catch ex As Exception
End Try
1:
SystemReady = True
在窗体控件 TabControl 的事件"SelectedIndexChanged, SelectedIndexChanging"中增加了"SystemReady=true",也均无效.
此外, 这个"生产问题跟踪表"在其它窗体也有调用,使用很正常.
请哪位大神帮帮我,谢谢!
[此贴子已经被作者于2023/9/13 10:54:23编辑过]