Dim e as Object = Args(0)
For Each dr As DataRow In DataTables("SY系统权限表").Select("分组名称 = '" & User.name & "'" )
If dr.IsNull("按扭名") =False Then
e.Form.Controls(dr("按扭名")).Visible = Not dr("不可见")
e.Form.Controls(dr("按扭名")).Enabled = Not dr("不可用")
End If
Next
Functions.Execute(函数名,e)
不过,通用函数还是多加一些必要的检查为好,如控件是否存在,否则一不小心就出错。