通过按钮直接点击没有问题。
通过同步Functions.asyncExecute() 执行报错
代码如下。大概有7-10个这样的按钮,最多修改数据,可以估计有大几十次(语句)
r("第一列") = regBN(0)
r("第二列") = regBN(1)
r("第三列”) = regBN(2)
r("进度”) = 12
表DrawCell事件
If e.Col.Name = "进度" AndAlso e.Row.IsNull("进度") = False Then
If e.Row("进度")>0 Then
e.StartDraw()
Dim 进度 As Integer= e.Row("进度")
Dim Width As Integer = (e.Width - 2) * 进度 \ 100
'Dim Width As Integer = (e.Width - 2) * e.Row("进度") \ 100
'e.Row("进度") = e.Row("进度")
If 进度 = 100 Then
e.Graphics.FillRectangle(Brushes.Green, e.x + 1, e.y + 1, Width, e.Height - 2)
Else
e.Graphics.FillRectangle(Brushes.Red, e.x + 1, e.y + 1, Width, e.Height - 2)
End If
e.EndDraw()
End If
End If
If e.Col.Name = "状态" Then
e.StartDraw()
If e.Row(e.Col.Name) ="重复" Then
e.Graphics.FillRectangle(Brushes.Red, e.x+1, e.y+1, e.Width-2 , e.Height-2 )
Else If e.Row(e.Col.Name) ="失败" Then
e.Graphics.FillRectangle(Brushes.YELLOW, e.x+1, e.y+1, e.Width-2 , e.Height-2 )
End If
e.EndDraw()
'Else
'
'e.Graphics.FillRectangle(Brushes.Green, e.x, e.y, e.Width , e.Height )
End If
[此贴子已经被作者于2024/4/18 9:40:26编辑过]