-- 作者:青丘狐
-- 发布时间:2023/3/14 11:28:00
-- 查询表DrawCell出错
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 用正常,在查询表里出错
|
-- 作者:青丘狐
-- 发布时间:2023/3/14 11:49:00
--
If e.Col.Name = "入库审核" Then if e.row.isnull("入库审核") then return 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 详细错误信息: 调用的目标发生了异常。 未将对象引用设置到对象的实例。
|
-- 作者:青丘狐
-- 发布时间:2023/3/14 12:17:00
--
If e.Col.Name = "入库审核" Then If e.Row.isnull("入库审核") Then Return MessageBox.Show(e.Row.isnull("入库审核")) 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 MessageBox.Show(tl) MessageBox.Show(msg) End Select
MessageBox.Show(tl) MessageBox.Show(msg)
这两个没有返回值,直接提示错误
.NET Framework 版本:4.0.30319.42000 Foxtable 版本:2022.8.18.1 错误所在事件:表,入库物资导入_Table1,DrawCell 详细错误信息: 调用的目标发生了异常。 未将对象引用设置到对象的实例。
|