Dim yisheng As WinForm.CheckBox = e.Form.Controls("Chkyishen")
Dim nm As String = e.Form.ActiveControl.Name
If e.Form.ActiveControl.Focused = True Then
Select Case nm
Case "Textchanpin","Textdanjia","Textguyuan","Textkehu","Textshuliang","Dateriqi"
If yisheng.Checked = True Then
If user.Group <> "经理" Then
e.Form.Controls(nm).ReadOnly = BooleanEnum.True
Else
e.Form.Controls(nm).ReadOnly = BooleanEnum.False
End If
Else
e.Form.Controls(nm).ReadOnly = BooleanEnum.False
End If
Case "Textjine"
e.Form.Controls(nm).ReadOnly = BooleanEnum.True
End Select
End If
-------------------------
窗口Enter事件的代码如上,重新切换用户以后,第一次点窗口空白处就出现错误提示了,个人能力有限找不到原因!出现错误提示框以后程序不崩溃,后面再点就正常了!
错误提示如下:Object variable or With block variable not set.