/// <summary> /// Adds the specified string with a following NewLine-command to the logTextBox. /// </summary> /// <param name="logLine">New line to write into the current log file.</param> /// <returns></returns> public void AddLogLine(string logLine) { if (logTextBox.InvokeRequired) { AddLogLineSafely d = new AddLogLineSafely(AddLogLine); Invoke(d, new object[] { logLine }); } else { string newLine = logLine + Environment.NewLine; logTextBox.Text += newLine; logTextBox.SelectionStart = logTextBox.TextLength; logTextBox.ScrollToCaret(); } }