Dim e As Object = Args(0)
Dim drs As List(Of DataRow) = DataTables("授权表").Select("(',' + 姓名 + ',' like '%," & _UserName & ",%' or ',' + 用户分组 + ',' like '%," & _Usergroup & ",%') And 窗口名1 = '" & e.Form.Name & "'")
If drs.Count = 0 Then
老师好,下面代码只要在授权表设置字段不用逻辑列(不可见)勾选 ,同样也打不开窗口。老师 能不能勾选后在打不开。
msgbox("你无权打开窗口")
e.Form.close
unlockbasemainform
Return False
End If
For Each dr As DataRow In drs
If dr("按扭名") = Nothing Then
msgbox("你无权打开窗口")
e.Form.close
unlockbasemainform
Return False
Else
e.Form.Controls(dr("按扭名")).Visible = not dr("不可见")
e.Form.Controls(dr("按扭名")).Enabled = not dr("不可编辑")
End If
Next
Return True