I have the following method which handles DoWork of my BackgroundWorker
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
How do I access the variable when called via a background worker?