请教老师,有这样一个问题,下面这段代码运行是正常的,但是同样的代码把Label130 替换成其他的 Label131或Label002....,打开窗口前提示就报错“无法找到控件Label131...... ” ,点击报错窗口确认后,正常窗口打开后代码功能是正常的。 如果不用以下代码,使用其他Label131控件是正常的,
也不报错,功能也正常的。 不知这是不是BUG。
在PictureBox3的BeforeGetImage里写入的代码:
Dim pbx As WinForm.PictureBox = e.Sender
Dim lbl As WinForm.Label = e.Form.Controls("Label130")
If lbl IsNot Nothing Then
Dim Count As Double
Count = DataTables("项目信息主表").Compute("Count(项目编号)","信息甄批_投审人员 Like '%" & _UserName & "%' and (信息甄批_投审确认 not Like '%" & _UserName & "%' or 信息甄批_投审确认 Is null)")
If Count = 0 Then
e.File = "Green.ico" '显示图片
ElseIf Count >= 1 Then
e.File= "Red.ico" '显示图片
End If
lbl.Text = "" & Count & ""
End If
[此贴子已经被作者于2016/6/26 17:11:48编辑过]