Pārlūkot izejas kodu

multithreading bug fix

Bart Reedijk 10 gadi atpakaļ
vecāks
revīzija
860b9f8f31
1 mainītis faili ar 6 papildinājumiem un 0 dzēšanām
  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);
         }
     }