0

我有以下方法来处理我的 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

通过后台工作人员调用时如何访问变量?

4

0 回答 0