Link to home
Start Free TrialLog in
Avatar of brokeMyLegBiking
brokeMyLegBiking

asked on

trigger event in parent thread

Is there a way to trigger an event in a parent thread while the child thread is still running?


I can call a method when the child thread finishes using the asynch callback, but not while its running.
ASKER CERTIFIED SOLUTION
Avatar of jj819430
jj819430

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Zamba1
Zamba1

@brokeMyLegBiking:
You have posted this question also in the VB.NET section with 500 points! This is usually not allowed here. Please use a pointer to the original question.

"What if my question fits more than one technical area?"
https://www.experts-exchange.com/help.jsp#hi262
Assuming the two threads are inside the same class, you can create an event in the class, subscribe to it in the parent thread, and trigger it from the child thread. You can even add parameters to the event to allow you to pass data between them.
Avatar of brokeMyLegBiking

ASKER

That sounds great! can you give me  a small sample, or point me to a link that shows some sample code?

What uKER described is excactly what I want to do. But i'm not sure how to declare a routine and subscribe that routine to a particular thread.

thx all!
anyone have a sample?