[COLOR=Blue]Private[/COLOR] [COLOR=Blue]Sub[/COLOR] BGWorker_DoWork([COLOR=Blue]ByVal[/COLOR] sender [COLOR=Blue]As[/COLOR] [COLOR=Blue]Object[/COLOR], [COLOR=Blue]ByVal[/COLOR] e [COLOR=Blue]As[/COLOR] DoWorkEventArgs)
[COLOR=Blue]Dim[/COLOR] Args [COLOR=Blue]As[/COLOR] [COLOR=Blue]Object[/COLOR]() = [COLOR=Blue]CType[/COLOR](e.Argument, [COLOR=Blue]Object[/COLOR]())
[COLOR=Blue]Try[/COLOR]
MyWorker.ParentForm = [COLOR=Blue]Me[/COLOR] 'Pass in your parent this is where your listview has been delcared
[COLOR=Blue]If [/COLOR][COLOR=Blue]CType[/COLOR](Args(0), Actions) = Actions.Analyse Then
MyWorker.DoAnalyse()
[COLOR=#0000ff]End If[/COLOR]
[COLOR=Blue]Catch[/COLOR] ex [COLOR=Blue]As[/COLOR] InvalidAsynchronousStateException
[COLOR=Blue]Throw[/COLOR] ex
[COLOR=Blue]Catch[/COLOR] ex [COLOR=Blue]As[/COLOR] Exception
[COLOR=Blue]Throw[/COLOR] ex
[COLOR=Blue]End[/COLOR] [COLOR=Blue]Try[/COLOR]
[COLOR=Blue]End[/COLOR] [COLOR=Blue]Sub[/COLOR]