Stackoverflow error in BackgroundWorker ProgressChanged
I have a search function in my program that uses a background worker in order to get the results. The Progress changed event is used to update the listview with the new item.

    Private Sub SearchWorker_ProgressChanged(ByVal sender As Object, ByVal e As System.ComponentModel.ProgressChangedEventArgs) Handles SearchWorker.ProgressChanged
        Dim itmX As ListViewItem
        Dim tmpCustomer As CustomerItem

        If e.UserState.ToString = "New" Then
            lstResults.Items.Clear()
        Else
            Try
                tmpCustomer = e.UserState
                itmX = lstResults.Items.Add(tmpCustomer.CustomerName) ' <-- Error here
                itmX.Tag = tmpCustomer.CustomerID
                itmX.Name = tmpCustomer.CustomerID
                itmX.SubItems.Add(tmpCustomer.City)
                itmX.SubItems.Add(tmpCustomer.State)
                itmX.SubItems.Add(tmpCustomer.Zip)
            Catch ex As Exception
                MsgBox(ex.Message)
            End Try
        End If

        progBar.Value = e.ProgressPercentage

        Application.DoEvents()
    End Sub

And I get this error

    An unhandled exception of type 'System.StackOverflowException' occurred in System.Windows.Forms.dll

I've tried this, but it doesn't make a difference

    Private Sub SearchWorker_ProgressChanged(ByVal sender As Object, ByVal e As System.ComponentModel.ProgressChangedEventArgs) Handles SearchWorker.ProgressChanged

        If e.UserState.ToString = "New" Then
            lstResults.Items.Clear()
        Else
            Try
                itmX = lstResults.Items.Add("Test")
            Catch ex As Exception
                MsgBox(ex.Message)
            End Try
        End If

        progBar.Value = e.ProgressPercentage

        Application.DoEvents()
    End Sub
Stackoverflow error in BackgroundWorker ProgressChanged
===

I have a search function in my program that uses a background worker in order to get the results. The Progress changed event is used to update the listview with the new item.

    Private Sub SearchWorker_ProgressChanged(ByVal sender As Object, ByVal e As System.ComponentModel.ProgressChangedEventArgs) Handles SearchWorker.ProgressChanged
        Dim itmX As ListViewItem
        Dim tmpCustomer As CustomerItem

        If e.UserState.ToString = "New" Then
            lstResults.Items.Clear()
        Else
            Try
                tmpCustomer = e.UserState
                itmX = lstResults.Items.Add(tmpCustomer.CustomerName) ' <-- Error here
                itmX.Tag = tmpCustomer.CustomerID
                itmX.Name = tmpCustomer.CustomerID
                itmX.SubItems.Add(tmpCustomer.City)
                itmX.SubItems.Add(tmpCustomer.State)
                itmX.SubItems.Add(tmpCustomer.Zip)
            Catch ex As Exception
                MsgBox(ex.Message)
            End Try
        End If

        progBar.Value = e.ProgressPercentage

        Application.DoEvents()
    End Sub

And I get this error

    An unhandled exception of type 'System.StackOverflowException' occurred in System.Windows.Forms.dll

I've tried this, but it doesn't make a difference

    Private Sub SearchWorker_ProgressChanged(ByVal sender As Object, ByVal e As System.ComponentModel.ProgressChangedEventArgs) Handles SearchWorker.ProgressChanged

        If e.UserState.ToString = "New" Then
            lstResults.Items.Clear()
        Else
            Try
                itmX = lstResults.Items.Add("Test")
            Catch ex As Exception
                MsgBox(ex.Message)
            End Try
        End If

        progBar.Value = e.ProgressPercentage

        Application.DoEvents()
    End Sub