MainTable = Tables("黄龙任务单")
Dim rc As Integer = Tables("黄龙任务单").rows.count
Dim d1 As Date = Date.now
'设置进度条2
Forms("现场单导至黄龙任务单进度条").open
Dim p2 As WinForm.ProgressBar
If Forms("现场单导至黄龙任务单进度条").opened Then
p2 = Forms("现场单导至黄龙任务单进度条").Controls("progressbar1")
p2.Maximum = rc '设置最大值
p2.Minimum = 0 '设置最小值
p2.Value = 0 '设置当前值
End If
Dim dt8 As WinForm.textbox
dt8 = Forms("现场单导至黄龙任务单进度条").Controls("textbox1")
Dim st8 As String = CStr(Date.now).substring(11, 8)
dt8.Value = st8
For Each r As Row In Tables("黄龙任务单").rows
'r("导至弯头单") = true
p2.Value = p2.Value + 1 '用于进度条2
Next
messagebox.show("<黄龙任务单> 导至 <弯头开料单> 已经完成!")
MainTable = Tables("弯头开料单")
Forms("黄龙任务单导至其他任务单").close
Dim d3 As Date = Date.now
Dim t3 As TimeSpan = d3 - d1
Dim dt9 As WinForm.textbox
dt9 = Forms("黄龙任务单导至其他任务单进度条").Controls("textbox2")
Dim st9 As String = CStr(Date.now).substring(11, 8)
dt9.Value = st9
Dim dt10 As WinForm.textbox
dt10 = Forms("黄龙任务单导至其他任务单进度条").Controls("textbox3")
dt10.Value = t3.Minutes & " 分 " & t3.Seconds & " 秒"
上述按钮里面的代码执行完之后,出现如下提示:
"黄龙任务单导至其他任务单进度条"已经关闭,不能调用其中的控件"textbox2"
.NET Framework 版本:4.0.30319.42000
Foxtable 版本:2022.8.18.1
错误所在事件:窗口,黄龙任务单导至其他任务单,Button1,Click
详细错误信息:
未将对象引用设置到对象的实例。
请问是什么原因呢?谢谢。