So I am scraping sites then collecting data and sending them to a listview. but when I do this with a thread it does not send them to the listview...
No thread: works
with thread: No works
Here is my delegate:
Inside the background worker I use this code:
If someone sees something I am doing wrong please say :)
No thread: works
with thread: No works
Here is my delegate:
Code
Private Delegate Sub ListViewAddItem_delegate(ByVal Title As String, ByVal Content As String)
Private Sub ListViewAddItem(ByVal Title As String, ByVal Content As String)
If CampaignForm.ListView1.InvokeRequired Then
Dim d As New ListViewAddItem_delegate(AddressOf ListViewAddItem)
CampaignForm.ListView1.BeginInvoke(d, {Title, Content})
Else
Dim lvi As New ListViewItem(Title)
lvi.SubItems.Add(Content)
CampaignForm.ListView1.Items.AddRange(New ListViewItem() {lvi})
CampaignForm.ListView1.Update()
End If
End SubInside the background worker I use this code:
Code
ListViewAddItem(Title, CountWords(Body))If someone sees something I am doing wrong please say :)


