Hi HemanthB-9452,
First, you need to add a "listboxItems" settingļ¼
Name - listboxItems, Type - System.Collections.ArrayList, Scope - User
Note that maybe you need to follow the steps to find System.Collections.ArrayList type:
Expand the type drop-down box->Browser->Input System.Collections.ArrayList in Selected type->ok
Then refer to the following code:
private void Form1_Load(object sender, EventArgs e)
{
// add all items from listbox1 to settings
var newList = new ArrayList();
foreach (object item in listBox1.Items)
{
newList.Add(item);
}
Properties.Settings.Default.listboxItems = newList;
Properties.Settings.Default.Save();
//you could load the list back like so:
listBox2.Items.AddRange(Properties.Settings.Default.listboxItems.ToArray());
}
Best Regards,
Daniel Zhang
If the response is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.