Hi, you have to use
CType
instead of
TryCast
.
TryCast
expects the parameters that you have passed to of Reference Type but JobItem is a Structure which is a Value type and hence the error. Which is not the case with
CType
.
This should work now:
Private Sub ProgressChanged(ByVal sender As Object, ByVal e As System.ComponentModel.ProgressChangedEventArgs)
Dim jb As JobItem = CType(e.UserState, JobItem)
End Sub
:)