Here is what you need to do: use
InvokeRequired
and
Invoke
of some other controls, first of all, of your form. It will work correctly!
Also, consider using
BeginInvoke
instead. If you're sure that your invocation call is always from non-UI thread, you may want to skip
InvokeRequired
check and always use
<code>
Invoke or
InvokeRequired
.
Please see all the detail in my other Answer:
Control.Invoke() vs. Control.BeginInvoke()[
^].
Now, I'll explain why it does not matter which control is used for calling the invocation methods. The invocation mechanism works at the level of
Application
and the thread running
Application.Run
usually called UI thread. The mechanism is described in the referenced document and further references and based on the queue. The only requirement for the
Control
instance which instance method is used for invocation is being a part of the same
Application
which is usually the case unless you try very risky tricks with threads and Forms.
—SA