If I have understood the question correctly
I would declare an event in your thread and then subscribe to the event from your main form.
Depending on what you want to whether you need your own event args class you could do something like
subscribe to the event on your main formCode://Thread event public static event EventHandler yourEventName;
after you have that done you should be able to use the following class to invoke the event across threads.Code:classname.yourEventName += mainform_yourEventName;
Invoke the eventCode:public static class Invoker { public static void Invoke(Delegate delegateToCall, params object[] argsOfDelegateToCall) { foreach (Delegate del in delegateToCall.GetInvocationList()) { ISynchronizeInvoke si = del.Target as ISynchronizeInvoke; if (si != null && si.InvokeRequired) si.Invoke(del, argsOfDelegateToCall); else del.DynamicInvoke(argsOfDelegateToCall); } } }
Hopefully that helpsCode:invoker.invoke(myHandler, this, eventargs.empty);
-zd




Reply With Quote