Foxtable(狐表)用户栏目专家坐堂 → [求助]DrawCell无法按指定条件绘制指定单元格


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

主题:[求助]DrawCell无法按指定条件绘制指定单元格

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


加好友 发短信
等级:版主 帖子:85326 积分:427815 威望:0 精华:5 注册:2012/10/18 22:13:00
  发帖心情 Post By:2015/3/20 14:48:00 [显示全部帖子]

Select Case e.Col.Name
    Case "设计","采购","生产","组装","调试","发货","现场"
        If e.Row(e.Col.Name) = "正常完成" Then
            e.Text = ""
            e.StartDraw
            e.Graphics.DrawImage(zcwc, e.x+3,e.y+2,e.Width-6, e.Height-4 )
            e.EndDraw
        Else If e.Row(e.Col.Name) = "延期完成" Then
            e.Text = ""
            e.StartDraw
            e.Graphics.DrawImage(yqwc, e.x+3,e.y+2,e.Width-6, e.Height-4 )
            e.EndDraw
        End If
   
End Select

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


加好友 发短信
等级:版主 帖子:85326 积分:427815 威望:0 精华:5 注册:2012/10/18 22:13:00
  发帖心情 Post By:2015/3/20 15:14:00 [显示全部帖子]

简写成这样

Select Case e.Col.Name
    Case "设计","采购","生产","组装","调试","发货","现场"
        If e.Row.IsNull(e.Col.Name) = False '且该列已经输入内容
            e.Text = ""
            e.StartDraw
            Select Case e.Row(e.Col.Name)
                Case "无计划"
                    e.Graphics.DrawImage(wjh, e.x+3,e.y+2,e.Width-6, e.Height-4 )
                Case "正常完成"
                    e.Graphics.DrawImage(zcwc, e.x+3,e.y+2,e.Width-6, e.Height-4 )
            End Select
            e.EndDraw
        End If
End Select


 回到顶部