How to add all items from listbox to settings? I tried by arraylist but I had error:
Object reference not set to an instance of an object.
I have no idea how to do this. Settings:
Name - listboxItems, Type - System.Collections.ArrayList, Scope - Application
private void button9_Click(object sender, EventArgs e)
{
//Save listBox Items
foreach (object item in listBox1.Items)
{
Properties.Settings.Default.listboxItems.Add(item);
}
Properties.Settings.Default.Save();
}