private void Ctrl_Write(string str) { try { int Line = ConsoleCtrl.Invoke(() => ConsoleCtrl.GetLineIndexFromCharacterIndex(ConsoleCtrl.SelectionStart)); int start = ConsoleCtrl.Invoke(() => ConsoleCtrl.GetCharacterIndexFromLineIndex(Line)); StringBuilder sb = new StringBuilder(); sb.AppendLine(str); ConsoleCtrl.Invoke(() => { ConsoleCtrl.AppendText(sb.ToString()); ConsoleCtrl.SelectionStart = ConsoleCtrl.Text.Length; }); } catch (Exception) { } }