private void addChatText(string txt) { const int maxLines = 50; chat.AppendBbcode(txt); //control max lines: happy ram int count = chat.GetLineCount(); if (count > maxLines) { int rest = count - maxLines; for (int i = 0; i < rest; i++) { chat.RemoveLine(i); } } }