Multi Thread In VB.net

Wednesday, July 22, 2009

Multi Threading in VB.Net

imports system.threading
Dim ThreadObject As Thread
ThreadObject = New Thread(AddressOf ClassName.functioname)
ThreadObject.Start()

_________________________________________________________________


The Thread generally does not accept any argument. you can create a constructor of a class and pass the required argument to that constructor.

E.g.:

ClassObject = New Classname(arg1,arg2,arg3,[]) /* The Constructor will assign pass the argument /*
ThreadObject = New Thread(AddressOf ClassName.functioname)
ThreadObject .Start()

__________________________________________________________________

Thread can not update to the control of the window directly but you can update the control of window by means of Delegate.