In VB10 (VS2010) you can do a pretty literal translation:
ThreadPool.QueueUserWorkItem(
Sub()
Console.WriteLine("Hello")
End Sub)
And note that linecontinuations (_) are not needed here.
But you probably want this for VS2008, and then you need to split the delegate as a separate Sub or Function.
Sub Main()
ThreadPool.QueueUserWorkItem(AddressOf CallBack, "Hello")
End Sub
Sub CallBack(ByVal state As Object)
Console.WriteLine(state)
End Sub
source
share