Foxtable(狐表)用户栏目专家坐堂 → BeforeGetImage及时变换的问题


  共有2320人关注过本帖树形打印复制链接

主题:BeforeGetImage及时变换的问题

帅哥哟,离线,有人找我吗?
douglas738888
  1楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:五尾狐 帖子:1172 积分:8772 威望:0 精华:0 注册:2012/4/18 16:28:00
BeforeGetImage及时变换的问题  发帖心情 Post By:2016/6/25 12:49:00 [只看该作者]

请教老师,以下代码写在BeforeGetImage,功能已经实现,但是,需要关闭一次窗口才能改变需要转换的图片,不能及时转换图片

想把以下代码写到TimerTick,但是报错,File 不是....的成员,请教老师怎样实现及时根据条件转换显示图片。

Dim pbx As WinForm.PictureBox = e.Sender
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
        e.File = "Gnome-Colors-Emblem-Green.ico" '显示图片
    ElseIf Count >= 1 Then 
        e.File = "Gnome-Colors-Emblem-Desktop-Red-32.png" '显示图片
    End If
End If

 回到顶部
帅哥哟,离线,有人找我吗?
Hyphen
  2楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:狐神 帖子:5015 积分:25363 威望:0 精华:0 注册:2015/8/18 9:21:00
  发帖心情 Post By:2016/6/25 14:58:00 [只看该作者]

需要绑定列,然后表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

 回到顶部