请问各位老师 下面程序执行在用窗口做两个按钮实验时没问题,正式运行的时候,红色那一句话条件成立,执行后没反应。
请帮忙分析。
该程序在窗口afterlode 事件下
If User.Type = UserTypeEnum.User Then
For Each c As WinForm.Control In e.Form.Controls
c.Enabled = False
Next
Dim drs As List(Of DataRow)
drs = DataTables("授权").Select(" [用户] Like '%" & user.group & "%' And [分组] = '" & e.Form.name & "'" )
If drs.count > 0 Then
For Each dr As DataRow In drs
If dr.IsNull("权限") Then
For Each c As WinForm.Control In e.Form.Controls
c.Enabled = True
Next
Else
e.Form.Controls(dr("权限")).Enabled = True
End If
Next
Else
MessageBox.show("您不能使用该功能")
Forms(e.Form.name ).close()
'
End If
End If