Zac Voicheq
Zac Voicheq

Reputation: 103

Saving contents of a listBox to program settings C#

So what I am trying to do is save the contents from a listBox to the application Properties.Settings.Default I have no idea where to start, nor do I know if it is even possible. Thanks in advance.

Upvotes: 0

Views: 1224

Answers (1)

RadioSpace
RadioSpace

Reputation: 952

any settings you have setup in Properties-> settings tab should show up like

[your namespace].Properties.Settings.Default.yoursetting = "change";

after you edit your properties always call

[your namespace].Properties.Settings.Default.Save();

the save part got me at first.

for list types use :

list setting

it will help if your objects can be converted to and from strings anything more not really sure for anything more complex but I hope this gets you started.

foreach(string s in listbox.Items){[settingscode].add(s);}

something like that anyways.

Upvotes: 1

Related Questions