Hi all, here is a code snippet I'm having trouble understanding.
public notinheritable class myClass
------Public Delegate Sub mySubDelegate()
------Public Sub mySub(ByVal Text As String)
-----------------If Me.InvokeRequired Then
------------------------Dim SI As New mySubDelegate(AddressOf mySub)
------------------------Me.Invoke(SI, New Object() {Text})
-----------------Else
------------------------ Text = "Something"
-----------------End If
------End Sub
End class
Assume that for the execution of mySub, that an invoke is required. So the IF condition should be satisfied. Why doesn't this code execute the ELSE section as well? My expectation was that the line: Me.Invoke(SI, New Object() {Text}) would cause the program to execute the Else section as well. Can anybody help me understand why it doesn't? Thanks.