if (listBox1.InvokeRequired) { listBox = new StringBuilder(this.listBox1.Text); }
This is the code in c# which when exec
InvokeRequired simply checks to see if Invoke is required. You found it's required, yet didn't call Invoke!