January 2003
Intermediate to advanced
896 pages
19h 58m
English
When a thread creates a control, it "owns" that control. The .NET Compact Framework dictates that only the owner thread can make method calls to controls. If you call control methods from a non-owning thread, you risk causing your application to freeze. The .NET Compact Framework therefore provides the Control.Invoke method, which permits method execution on controls in a safe manner. You can’t call Control.Invoke from the thread that owns the control, but you can safely call the method from any other thread. Control.Invoke has two overloads:
public object Control.Invoke(Delegate method) public virtual object Control.Invoke(Delegate method, Object[] args)
This code causes the execution of the specified delegate ...
Read now
Unlock full access