Ok, so in most cases when we need to make a threaded call we need to pass multiple parameters to the worker function. In VB.net by default it supports one parameter to be passed. But when we need to pass more than one parameter then we have to do a little trick.
Public sub thread_worker(ByVal empId as int32, ByVal empName as String, ByRef displayPanel as Panel, ByRef log_output as String)
'Create a generic Objects Array
Dim param_obj(4) as Object
param_obj(0) = empId
param_obj(1) = empName
param_obj(2) = displayPanel
param_obj(3) = log_output
dim worker_thread as New Thread(addressOf showEmpInfo);
Public Sub showEmpInfo(ByVal param_objx as Object)
Dim empIdx as Int32, empNamex as String, displayPanelx as Panel, log_outputx as String
empIdx = param_obj(0)
empNamex = param_obj(1)
displayPanelx = param_obj(2)
log_outputx = param_obj(3)
dim empLabel as New Label
empLabel.Text = empIdx & " " & empNamex
log_outputx &=" added EmpID: " & " To the Display" & vbCrLf
Observe how the Object array is passed as a parameter using ByVal. When the array is populatd it will contain the refereces/address of the objects. So passing it by value actually passes the whole set of the references.
Thus this trick works even for ByRef variables/Reference variables/Pointer Variables.