I had created a list of threads
to achieve Multi Threading
that all accepting a single function that returning value. Following is the code that i had tried:
Creation of threads
Dim txt as String
For i As Integer = 0 To 15
txt = ""
txt = UCase(array.Item(i))
Dim tempThread As Threading.Thread = New Threading.Thread(AddressOf threadRead)
tempThread .Start(txt) ' start thread by passing value to it
Threads.Add(tempThread ) 'Add thread to the list
'Here i want to add the return value from the thread to RichTextbox
'as follows
RichTextBox1.Text = RichTextBox1.Text & vbNewLine & tempThread.ReturnValue
Next
Function that is addressed by the thread
Public Function threadRead(ByVal txtInput As String) As String
Dim stroutput As String = ""
' Some operations are performed here
Return stroutput
End Function
So the problem is that i can't access the returning value from the called function. can anyone suggest me some method to achieve this?
Thanks in advance