Hi again, I'm adding a standard text of mine about cross-thread access to GUI Controls, since you will probably need such info anyway: Controls are not thread-safe, hence they should be touched (that is: their methods or properties called) only by the thread that created them, which normally is the main thread (aka GUI thread). Creating some controls on a different thread is unlikely to be successful, since all Controls get linked somehow: they reside on Forms, Forms are related to each other (by Parent, by Z-Order, etc), so normally all are created on a single thread. If you violate the “don’t touch Controls from another thread” rule and are running .NET version 2.0 or above you will get an InvalidOperationException (“Cross-thread operation not valid”), which should be remedied by changing the code. Do not set Control.CheckForIllegalCrossThreadCalls false, since that does hide the exception but does not cure the fundamental flaw in your code, so it just postpones the moment of failure, which typically will show as a non-responsive and possibly badly painted GUI. Here are some ways to get another thread: - explicitly launching a Thread instance - explicitly delegating some work to a ThreadPool thread - using a BackgroundWorker; a BGW is a separate thread with the advantage that two of its events (ProgressChanged and RunWorkerCompleted) execute on the GUI thread; however the bulk of the work normally is handled in the DoWork handler which runs on a distinct thread. - using timers other than System.Windows.Forms.Timer; the Forms timer ticks on the GUI thread, all other use different threads to handle the periodic event; - using asynchronous input/output, such as the DataReceived event of the SerialPort class Any of these touching a single method or property of a Control is sufficient to create havoc; there are 5 exceptions: - the InvokeRequired property - the Invoke, BeginInvoke, EndInvoke and CreateGraphics methods (the latter only if the handle for the control has already been created). If there is a need to touch the Control from another thread, one must use an Invoke pattern, which basically looks like this (using C# code, same can be done in VB.NET):
public void SetText(string text) {
if (myControl.InvokeRequired) {
// this runs on the foreign thread and causes the
// invocation of this same method on the GUI thread
myControl.Invoke(new Action< string >(SetText),
new object[] {text});
} else {
// this runs on t