Passing information to thread

I’ve moved several connected functions to a thread. There is a main function which calls several other functions to do calculations.
How do I pass variables from the UI to the main function in the thread.

Should i just call mythread.run and have the main function get public properties from the UI?
or
should I create properties in the thread class so the UI can set them before .run?
or
is there a way to pass information to the main function in the tread when you run it?

The second thing.

Okay, I forgot to say, I’m processing a listbox contents, does putting all the items in an array and passing that to the thread seem the right thing to do?
I want to update a column in the listbox with the result.
Or better to pass the whole listbox to the thread? Won’t that cause a thread exception.

Most likely, transfer to an array first.

I usually add a new Run method to the thread subclass that accepts parameters. It stores them in properties of the subclass and then calls the real Run method.

Another silly question - what is the best way to return information from a thread?
I pass each item on the listbox to a new thread for processing, how do I put the result back in the next column of the listbox if the thread can’t update the UI?
I can’t find any examples in the documentation of this.

Add a timer in the window that watch an integer property set by the thread.
The Timer put the result back in the next column of the listbox.