Listbox1.Text.ToString().Split(',').ToList().ForEach(r => Listbox1.Items.Add(r.Trim()));
Statements like that are great until they don't work. Separate it into its constituent parts and use your debugger to see exactly what is happening. I would also suggest that this code should be inside the preceding
if
clause.