joe_pool_is Posted April 16, 2008 Posted April 16, 2008 I've got an application with a thread that works great except for one thing: I don't know how to get the thread to signal and pass information back to the main form. What is the best way to do this in VB or C# 2005? Quote Avoid Sears Home Improvement
Administrators PlausiblyDamp Posted April 17, 2008 Administrators Posted April 17, 2008 Depending on your needs the two easiest ways are: 1) Pass a callback function to the thread so the thread can call this method as a means of signalling the parent. 2) Declare an event the thread can raise to signal the parent. Another possibility is if the parent thread has a message pump (normally means it is a UI thread) the background thread could use either the SendMessage or PostMessage APIs to signal the parent. Personally I would choose either the callback or event based methods though. Quote Posting Guidelines FAQ Post Formatting Intellectuals solve problems; geniuses prevent them. -- Albert Einstein
joe_pool_is Posted April 17, 2008 Author Posted April 17, 2008 Thanks for the idea. I was able to Invoke a Delegate with a TextBox Control. Quote Avoid Sears Home Improvement
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.