public static void ClearLastConsoleLines(int count)
{
int cursorTop = Console.CursorTop;
if ((count == cursorTop) || (count == 0))
{
Console.Clear();
}
else if ((count < cursorTop) && (count > 0))
{
string str = new string(' ', Console.WindowWidth * count);
Console.SetCursorPosition(0, cursorTop - count);
Console.Write(str);
Console.SetCursorPosition(0, cursorTop - count);
}
}

public void LineEdit(int Line, string NewValue, bool Clear = false)
{
int LinesLengh = richTextBox1.Lines.Length;
if (Line >= LinesLengh)
MessageBox.Show("Error - Line don't Exsist!");
else
{
string[] TempData = richTextBox1.Lines;
TempData[Line] = NewValue;
richTextBox1.Lines = TempData;
}
if (Clear)
richTextBox1.Clear();
}
LineEdit(1, "Wonder");