You need to return the work to the user interface; fortunately, this is easy:
this.Invoke((MethodInvoker) delegate {
this.textBox1.Text = sb.ToString();
});
" " " " #, . .NET 3.5 Action, :
this.Invoke((Action) delegate {
this.textBox1.Text = sb.ToString();
});