public void AppendStatusText(string text, Color text_color)
{
// InvokeRequired required compares the thread ID of the
// calling thread to the thread ID of the creating thread.
// If these threads are different, it returns true.
if (this.statusBox.InvokeRequired)
{
AppendTextCallback d = new AppendTextCallback(AppendStatusText);
this.Invoke(d, new object[] { text, text_color });
}
else
{
this.statusBox.SelectionColor = text_color;
this.statusBox.AppendText(text);
this.statusBox.ScrollToCaret();
}
}