You Are Here : Home » , » Threading in VB.NET

Threading in VB.NET


There's two ways to do this;
  1. With the AddressOf operator to an existing method
    Sub MyBackgroundThread()
      Console.WriteLine("Hullo")
    End Sub
    And then create and start the thread with;
    Dim thread As New Thread(AddressOf MyBackgroundThread)
    thread.Start()
  2. Or as a lambda function.
    Dim thread as New Thread(
      Sub() 
        Console.WriteLine("Hullo")
      End Sub
    )
    thread.Start()

No comments:

Leave a Reply

Copyright © Source Code Hacking. Designed by Momizat Team. Powered to Blogger by SpicyTweaks.

Scroll to top