Your code in the "Background" thread checks to see if it is on the UI thread
If Me.InvokeRequired Then
and if not, it tells it to run on the UI thread.
Me.Invoke(New MethodInvoker(AddressOf BackgroundProcess))
If it is on the UI thread, it sits in a loop, blocking the UI thread, without pumping.
Do While True
To get this to work, one of the MANY ways to do it is like this:
Public Delegate Sub AddItemDelegate(ByVal item As Object)
Public Sub BackgroundProcess()
Dim i As Integer = 1
Do While True
i += 1
If Me.InvokeRequired Then
Me.Invoke(New AddItemDelegate(AddressOf AddItem), "Iteration:" & i)
Else
AddItem("Iteration:" & i)
End If
Loop
End Sub
Private Sub AddItem(ByVal item As Object)
Me.ListBox1.Items.Add(item)
End Sub
Using a delegate is the prefered way.