Skip to content

Instantly share code, notes, and snippets.

@MKo-xx
Created December 25, 2010 10:06
Show Gist options
  • Save MKo-xx/754806 to your computer and use it in GitHub Desktop.
Save MKo-xx/754806 to your computer and use it in GitHub Desktop.
update text box from another thread
delegate void SetTextCallback(string newText);
private void add_output(string text)
{
if (this.output_textBox.InvokeRequired)
{
SetTextCallback d = new SetTextCallback(add_output);
this.Invoke(d, new object[] { text });
}
else
{
this.output_textBox.Text += text;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment