加入msgbox,看弹出什么东西。
msgbox(e.Sender.Name.SubString(0,4))
If e.Sender.Name.SubString(0,4) = "_cmb" Then '如果名称符合
Dim cmb As WinForm.ComboBox = e.Sender
If cmb.Items.Count > 0 Then '如果已经设置了项目
Else
Dim t As Table = cmb.BindTable '获得绑定的Table
Dim c As Col = cmb.BindCol '获得绑定的Col
Dim dr As DataRow = DataTables("组合框代码").Find("[表] = '" & t.Name & "' And [列] = '" & c.Name & "'")
If dr IsNot Nothing Then '如果在项目表找到对应的行
cmb.Combolist = dr("列表项目") '则设置列表项目
End If
End If
End If
Dim ctl As WinForm.Control = e.Sender
Dim r As Row = Tables("制造质量管理").Current '定义当前行检验员姓名
If r IsNot Nothing Then
msgbox(r("检验员"))
If User.Name = "开发者" Then
ctl.ReadOnly = BooleanEnum.False '允许编辑
Else
If User.Name = r("检验员") Then '如果登陆者姓名等于当前行检验员姓名
ctl.ReadOnly = BooleanEnum.False '允许编辑
Else
ctl.ReadOnly = BooleanEnum.True '否则禁止编辑
End If
End If
End If