Dim e As Object = Args(0)
Dim drs As List(Of DataRow) = DataTables("授权表").Select("(',' + 姓名 + ',' like '%," & User.Name & ",%' or ',' + 用户分组 + ',' like '%," & User.group & ",%') And 窗口名 = '" & 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