Jelajahi Sumber

multithreading bug fix

Bart Reedijk 10 tahun lalu
induk
melakukan
860b9f8f31
1 mengubah file dengan 6 tambahan dan 0 penghapusan
  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);
         }
     }