First off arr.ToString won;t help it will just give you the name of the type, rather than any of the content. Namely "System.Collections.ArrayList"
Second, please don't use ArrayList any more - it was superceded nearly ten years ago with teh much safer and more flexible generic collection such as List<>
Thirdly, your problem is simply that you are setting the rich text box text each time, throwing away any previous text.
Try this:
List<string> list = new List<string>();
for (int i = frm; i <= to; i++)
{
barcode = prefix + i + suffix;
list.Add(barcode);
}
StringBuilder sb = new StringBuilder();
foreach (string s in list)
{
sb.Append(s);
}
richTextBox1.Text = sb.ToString;
Or if you don't need the data again:
richTextBox1.Clear();
for (int i = frm; i <= to; i++)
{
richTextBox1.AppendText(string.Format("{0}{1}{2}", prefix, i, suffix));
}
Replaces all of your code...