需要绑定列,然后表Currentchanged的时候才会触发事件
放到计时器代码改成
Dim pbx As WinForm.PictureBox = e.Form.Controls("PictureBox1")
Dim lbl As WinForm.Label = e.Form.Controls("Label3")
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
pbx.ImageFile = "Gnome-Colors-Emblem-Green.ico" '显示图片
ElseIf Count >= 1 Then
pbx.ImageFile= "Gnome-Colors-Emblem-Desktop-Red-32.png" '显示图片
End If
End If