Hello,
to not block the UI of my applications when there is a long operation I use to do:
Public Sub ButtonHandler() handles Button
Dim auxDelegate as Action
auxDelegate = New Action(AddressOf DoAction)
auxDelegate.BeginInvoke(AddressOf EndAction,Nothing)
End Sub
Private Sub DoAction()
''# Do long time operations here
End Sub
Private Sub EndAction()
''# Update results here
End Sub
Is there a way to take the result of DoAction in case that it is a Function instead of a Sub and use that result at EndAction other that defining a class attribute and put the value there?
For example, if DoAction is like this:
Private Function DoAction() As Boolean
return True
End Sub
There is a way of taking the result of DoAction at EndAction?
Thanks in advance!