String^ _str = ""; Random^ randObj = gcnew Random; //Random object with an auto-generated seed int x = randObj->Next(1, 100); int y = randObj->Next(1, 100); _str += x.ToString() + "\n"; _str += y.ToString() + "\n"; richTextBox_Log->AppendText(_str); richTextBox_Log->ScrollToCaret();