okay, So i have form1, with listbox1
and class Kws.vb which scrapes web elements from a specified page with a lot of other settings.
I created another class, because I wanted to practice using other threads. and to make multithreading much better.
The problem is this:
For some reason it doesn't work. when I instead put msgbox(allkws(i).ToString)
it will spam me with all the elements
What is causing it to not add items across classes?
Form1:
Form2:
Please help
and class Kws.vb which scrapes web elements from a specified page with a lot of other settings.
I created another class, because I wanted to practice using other threads. and to make multithreading much better.
The problem is this:
Code
Form1.Allkws.Items.Add(allkws(i).ToString)For some reason it doesn't work. when I instead put msgbox(allkws(i).ToString)
it will spam me with all the elements
What is causing it to not add items across classes?
Form1:
Code
Public Class Form1
Dim pages As New ListBox
Public Allkws As New ListBox
Private Sub Button1_Click(sender As System.Object, e As System.EventArgs) Handles Button1.Click
Dim Thread1 As System.Threading.Thread = New System.Threading.Thread(AddressOf quickStart)
Thread1.Start()
'quickStart()
End Sub
Sub quickStart()
Allkws = New ListBox
For Each item In GetList(TextBox1.Text).Items
Dim kws As New Kws
kws.Page = item
ThreadPool.QueueUserWorkItem(AddressOf kws.getKws)
Next
waitTillThreadPoolisIdle()
MsgBox(Allkws.Items.Count.ToString)
End SubForm2:
Code
If allstuff.Contains(", ") Then
Dim allkws As String() = allstuff.Split(", ")
Dim i As Integer = 0
While i <= allstuff.Split(", ").Length - 1
Form1.Allkws.Items.Add(allkws(i).ToString)
i = i + 1
End While
End IfPlease help



