I am trying to create a new thread using an anonymous function but I keep getting errors. Here is my code:
New Thread(Function() // Do something here End Fu
What is called has to be a functinon not a sub.
Single line(has to return value):
Dim worker As New Thread(New ThreadStart(Function() 42))
Multiline:
Dim worker As New Thread(New ThreadStart(Function() ' Do something here End Function))
Source: Threading, Closures, and Lambda Expressions in VB.Net