In .NET CF, you must use "EventHandler" delegate for "Form.Invoke" method.
You could make a simple EventDispatcher to dispatcher the job with custom
delegate and event arguments.
I wrote a handy dispatcher for synchronizing events between worker thread
and form thread. The code is adhered below:
*** START of EventDispatcher.cs ***
using System;
using System.Windows.Forms;
namespace MyApplication {
public sealed class EventDispatcher {
public static void Invoke( Control control, EventHandler handler, object
sender, EventArgs args ) {
control.Invoke( new EventHandler( new EventDispatcher( handler, sender,
args ).ProxyHandler ) );
}
private EventDispatcher( EventHandler realHandler, object sender,
EventArgs args ) {
this._realHandler = realHandler;
this._sender = sender;
this._args = args;
}
private EventHandler _realHandler;
private object _sender;
private EventArgs _args;
private object Sender {
get { return( this._sender ); }
}
private EventArgs Args {
get { return( this._args ); }
}
private EventHandler RealHandler {
get { return( this._realHandler ); }
}
private void ProxyHandler( object sender, EventArgs args ) {
this.RealHandler( this.Sender, this.Args );
}
}
}
*** END ***
Hope it helps.
Compulim @ kasuei