I have this class and I have a loop that launches multiple threads from the same class. This is all done from the main form.
Now I want to update the richtextbox on the main from these classes.
I have tried those begininvokes etc etc and nothing worked, no error but no output as well.
Here the code for launching the threads :
Private PingObjects(100000) As Account 'Account is the class and login is the sub in it...
PingObjects(I) = New Account
Threads(I) = New Threading.Thread(AddressOf PingObjects(I).login)
Threads(I).IsBackground = True
Threads(I).Start()
And to update the rtb, im using MainForm.log.text = “…..”
Nothing happens, no error.
I have tried using the begin invoker method as well.
Found the solution !!
I have found the solution on another forum credits : facebookdoom on HF
In mainform
Make new interface class :-
Public Interface Interface1
Sub AppendLog(ByVal update As String)
End Interface
Put this in thread class :
Private ReadOnly _form As Interface1
Public Sub New(ByVal form As Form)
_form = form
End Sub
Usage :-
_form.AppendLog(“aaaaaa”)