private void WriteMessage(string message) { if (InvokeRequired) { this.Invoke(new Action <string>(WriteMessage), message); } else { if (ServerLog.Text != "") { ServerLog.AppendText(Environment.NewLine); } ServerLog.Select(ServerLog.TextLength, 0); ServerLog.AppendText("Server >> " + message); ServerLog.SelectionStart = ServerLog.TextLength; ServerLog.SelectionLength = 0; ServerLog.ScrollToCaret(); } }