'窗口控件权限
For Each dr11 As DataRow In DataTables("窗口控件权限表").DataRows
If dr11.IsNull("角色") = False Then
Dim nms() As String = dr11("角色").Split(",")
For Each nm As String In nms
If _UserRoles.contains(nm) Then
For Each dr As DataRow In DataTables("窗口控件权限表").Select("角色 like '%" & nm & "%'")
If dr.isnull("控件名称")=False Then
Forms(dr("窗口名称")).Controls(dr("控件名称")).Enabled = False
End If
Next
End If
Next
End If
Next
上述代码在具体窗口的AfterLoad中是有效的,但在AfterOpenProject中无效,象这样的设置只能在每个窗口单独运行吗