CheckForIllegalCrossThreadCalls

For accessing controls in a different thread from which they were created, set (static variable)

TextBox.CheckForIllegalCrossThreadCalls = false;
http://msdn.microsoft.com/en-us/library/system.windows.forms.control.checkforillegalcrossthreadcalls.aspx

Without this, you will get the error
“Cross-thread operation not valid: Control accessed from a thread other than the thread it was created on”

However, this is not a good idea for production code.
http://discuss.joelonsoftware.com/default.asp?dotnet.12.460561.4
Please be warned

Comments