What you say does not make any sense. Both
Control
's and
Dispatcher
's methods
Invoke
and
BeginInvoke
invoke delegate instance on the UI thread, so, these methods do the same. Also,
Dispatcher
can well be used on Forms; you can easily check it up.
These method won't work if you want to delegate instances from one thread to another thread which is not a UI thread. However, it's easy to create a similar mechanism by yourself, but only for threads for which the similar mechanism is usable; that is, such thread should have a loop handling all delegate instanced submitted for invocation. I explained how it works in detail in my article
Simple Blocking Queue for Thread Communication and Inter-thread Invocation[
^].
Note that you don't have to use my queue class, as you can use
System.Collections.Concurrent.BlockingCollection<>
. But with my article complete with usage samples, you can see how to use it for implementation of the invocation of the delegate instance on a different thread.
See also my past answers:
Control.Invoke() vs. Control.BeginInvoke(),
Problem with Treeview Scanner And MD5,
.NET event on main thread,
How to get a keydown event to operate on a different thread in vb.net,
Control events not firing after enable disable + multithreading.
—SA