Explorar el Código

multithreading bug fix

Bart Reedijk hace 10 años
padre
commit
860b9f8f31
Se han modificado 1 ficheros con 6 adiciones y 0 borrados
  1. 6 0
      Proftaak Remote Healthcare/Fietsclient/MainForm.cs

+ 6 - 0
Proftaak Remote Healthcare/Fietsclient/MainForm.cs

@@ -34,6 +34,12 @@ namespace Fietsclient
 
         private void addTextToLog(string text)
         {
+            if (this.InvokeRequired)
+            {
+                this.Invoke((new Action(() => addTextToLog(text))));
+                return;
+            }
+
             textBox1.AppendText(text);
         }
     }