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 用正常,在查询表里出错