Dim e As Object = Args(0)
dim dr2 as datarow = DataTables("授权表").Find("(\',\' + 姓名 + \',\' like \'%," & _UserName & ",%\' or \',\' + 用户分组 + \',\' like \'%," & _Usergroup & ",%\') And 窗口名1 = \'" & e.Form.Name & "\' and 不可见=false and 按扭名 is null")
if dr2 is nothing then
msgbox("你无权打开窗口")
e.Form.close
unlockbasemainform
Return False
end if
Dim drs As List(Of DataRow) = DataTables("授权表").Select("(\',\' + 姓名 + \',\' like \'%," & _UserName & ",%\' or \',\' + 用户分组 + \',\' like \'%," & _Usergroup & ",%\') And 窗口名1 = \'" & e.Form.Name & "\' and 按扭名 is not null")
For Each dr As DataRow In drs
e.Form.Controls(dr("按扭名")).Visible = not dr("不可见")
e.Form.Controls(dr("按扭名")).Enabled = not dr("不可编辑")
Next
Return True