我有以下方法处理我的BackgroundWorker的DoWork
Public Class BackgroundRunner
Private Sub BgTask(ByVal sender As Object, ByVal e As DoWorkEventArgs)
AnotherForm.BgTask(e.Argument)
End Sub
End Class
Public Class AnotherForm
Public StartDate As Date
Public Function BgTask(ByVal e As Object)
'When I access StartDate here
'when called via backgroundWorker, I get the default value of 12:00:00 AM
'When called from another method in the same form, I get its original value
End Function
End Class
如何通过后台工作程序调用时访问变量?