Control.Invoke() vs. Control.BeginInvoke()
Posted
by
user590088
on Stack Overflow
See other posts from Stack Overflow
or by user590088
Published on 2011-02-18T06:30:56Z
Indexed on
2011/02/18
7:25 UTC
Read the original article
Hit count: 122
c#
First of all, I would like to apologize for my bad grammar since English is not my native tongue.
This is my understanding:
Control.Invoke(delegated_method) // Executes on the thread wich the control was created on
witch holds its handle ,typically this would be the main thread of a winform application .
Control.BeginInvoke(delegated_method // Executes asynchronously on a threadPool Thread .
According to MSDN, it says
Executes a delegate asynchronously on the thread that the control's underlying handle was created on.
My QUESTION :
Am I to understand that beginInvoke treats the main thread in this matter as it would the thread pool, and execute the delegated method on the main thread when it "gets a chance" ?
Another question which is raised, is it possible to create a control not on the main thread ? if so could someone give me an example?
© Stack Overflow or respective owner