I know how to do a thread safe update on a text box that was already defined http://msdn.microsoft.com/en-us/library/ms171728.aspx …. how can i do this on text boxes that were generated later on in the program? You advice is much appreciated.
Share
Given some
TextBoxobject, just invoke on it:If you’re using this pattern a lot, this extension method might be helpful:
Then you can reduce your code to:
This will just do the right thing, executing the delegate on the main GUI thread whether or not you are currently executing on it.