Foxtable(狐表)用户栏目专家坐堂 → 查询表DrawCell出错


  共有2228人关注过本帖平板打印复制链接

主题:查询表DrawCell出错

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


加好友 发短信
等级:小狐 帖子:346 积分:2645 威望:0 精华:0 注册:2018/11/11 15:52:00
查询表DrawCell出错  发帖心情 Post By:2023/3/14 11:28:00 [只看该作者]

If e.Col.Name = "入库审核" Then
    e.StartDraw()
    Dim msg As String
    Dim tl As Integer = e.Text.Length
    Select Case tl
        Case 2
            msg = "  " & e.Text & "  "
        Case 3
            msg = " " & e.Text & " "
        Case Else
            msg = e.Text
    End Select
    If msg = "" Then Return
    If tl <= 4 Then
        e.Col.Width = 61
    Else
        e.Col.width = tl * 15 + 1
    End If
   
    Dim w As Integer = e.Width - 4
    Dim h As Integer = e.Height - 4
    Dim x As Integer = e.x + (e.Width - w) / 2
    Dim n As Pen
    Dim fnt As New Font("宋体", 9, FontStyle.Bold)
    Dim br As Brush
   
    If e.Text.Contains("已") Then
        n = New Pen(Color.Green, 2)
        br = New SolidBrush(color.Green)
    Else
        n = New Pen(Color.Red, 2)
        br = New SolidBrush(color.red)
    End If
   
    e.Graphics.DrawRectangle(n, x, e.y + 2, w, h)
    e.Graphics.DrawString(msg, fnt, br, x + 1, e.y + 4)
    e.Text = ""
    e.EndDraw()
End If

 

 

.NET Framework 版本:4.0.30319.42000
Foxtable 版本:2022.8.18.1
错误所在事件:表,入库物资导入_Table1,DrawCell
详细错误信息:
调用的目标发生了异常。
未将对象引用设置到对象的实例。

 

在外部表用DrawCell 用正常,在查询表里出错


 回到顶部